0

I am getting exception while running. It compiles correctly but can't start application. So how can i handle this exception and run my code.
The Exception is:

DANGER: Gdk-WARNING, gdk_window_set_icon_list: icons too large
Exception in thread "main" org.gnome.glib.FatalError: Gdk-WARNING gdk_window_set_icon_list: icons too large at org.gnome.gtk.GtkWidget.gtk_widget_show_all(Native Method) at org.gnome.gtk.GtkWidget.showAll(GtkWidget.java:541) at org.gnome.gtk.Widget.showAll(Widget.java:182) at ExamplePressMe.Main.main(Main.java:23) .

<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.16.1 -->
<interface>
  <requires lib="gtk+" version="3.10"/>
  <object class="GtkWindow" id="window1">
    <property name="name">XYZ Copier</property>
    <property name="can_focus">False</property>
    <property name="title" translatable="yes">XYZ Copier</property>
    <property name="resizable">False</property>
    <property name="default_width">520</property>
    <property name="default_height">150</property>
    <property name="icon">icon.png</property>
    <child>
      <object class="GtkBox" id="box1">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="orientation">vertical</property>
        <child>
          <object class="GtkGrid" id="grid2">
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="margin_top">4</property>
            <property name="margin_bottom">4</property>
            <child>
              <object class="GtkLabel" id="label2">
                <property name="visible">True</property>
                <property name="can_focus">False</property>
                <property name="margin_left">3</property>
                <property name="margin_right">16</property>
                <property name="label" translatable="yes">Total Progress :</property>
              </object>
              <packing>
                <property name="left_attach">0</property>
                <property name="top_attach">0</property>
                <property name="width">1</property>
                <property name="height">1</property>
              </packing>
            </child>
            <child>
              <object class="GtkLabel" id="label6">
                <property name="visible">True</property>
                <property name="can_focus">False</property>
                <property name="margin_left">2</property>
                <property name="margin_right">2</property>
                <property name="label" translatable="yes">Moving file 5  of 10 (220 Mb of 1230 Mb)</property>
              </object>
              <packing>
                <property name="left_attach">2</property>
                <property name="top_attach">0</property>
                <property name="width">1</property>
                <property name="height">1</property>
              </packing>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">True</property>
            <property name="position">1</property>
          </packing>
        </child>
        <child>
          <object class="GtkProgressBar" id="progressbar1">
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="margin_top">6</property>
            <property name="margin_bottom">5</property>
            <property name="pulse_step">0</property>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">True</property>
            <property name="padding">2</property>
            <property name="position">2</property>
          </packing>
        </child>
        <child>
          <object class="GtkGrid" id="grid3">
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="margin_top">4</property>
            <property name="margin_bottom">4</property>
            <child>
              <object class="GtkSeparator" id="separator1">
                <property name="visible">True</property>
                <property name="can_focus">False</property>
              </object>
              <packing>
                <property name="left_attach">1</property>
                <property name="top_attach">0</property>
                <property name="width">1</property>
                <property name="height">1</property>
              </packing>
            </child>
            <child>
              <object class="GtkLabel" id="label3">
                <property name="visible">True</property>
                <property name="can_focus">False</property>
                <property name="xpad">3</property>
                <property name="label" translatable="yes">Current progress :</property>
              </object>
              <packing>
                <property name="left_attach">0</property>
                <property name="top_attach">0</property>
                <property name="width">1</property>
                <property name="height">1</property>
              </packing>
            </child>
            <child>
              <object class="GtkLabel" id="label4">
                <property name="visible">True</property>
                <property name="can_focus">False</property>
                <property name="label" translatable="yes">Moving  XYZ to PQR</property>
              </object>
              <packing>
                <property name="left_attach">3</property>
                <property name="top_attach">0</property>
                <property name="width">1</property>
                <property name="height">1</property>
              </packing>
            </child>
            <child>
              <object class="GtkLabel" id="label5">
                <property name="visible">True</property>
                <property name="can_focus">False</property>
                <property name="xalign">0</property>
                <property name="yalign">1</property>
                <property name="xpad">14</property>
                <property name="label" translatable="yes">Speed : 24 Mbps</property>
              </object>
              <packing>
                <property name="left_attach">5</property>
                <property name="top_attach">0</property>
                <property name="width">1</property>
                <property name="height">1</property>
              </packing>
            </child>
            <child>
              <object class="GtkSeparator" id="separator2">
                <property name="visible">True</property>
                <property name="can_focus">False</property>
              </object>
              <packing>
                <property name="left_attach">2</property>
                <property name="top_attach">0</property>
                <property name="width">1</property>
                <property name="height">1</property>
              </packing>
            </child>
            <child>
              <object class="GtkSeparator" id="separator3">
                <property name="visible">True</property>
                <property name="can_focus">False</property>
              </object>
              <packing>
                <property name="left_attach">4</property>
                <property name="top_attach">0</property>
                <property name="width">1</property>
                <property name="height">1</property>
              </packing>
            </child>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">True</property>
            <property name="padding">2</property>
            <property name="position">3</property>
          </packing>
        </child>
        <child>
          <object class="GtkProgressBar" id="progressbar2">
            <property name="visible">True</property>
            <property name="can_focus">False</property>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">True</property>
            <property name="padding">4</property>
            <property name="position">4</property>
          </packing>
        </child>
        <child>
          <object class="GtkGrid" id="grid4">
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="margin_top">4</property>
            <property name="margin_bottom">4</property>
            <child>
              <object class="GtkButton" id="button1">
                <property name="label" translatable="yes">Skip Current File</property>
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="receives_default">True</property>
                <property name="margin_left">40</property>
                <property name="margin_right">40</property>
                <property name="relief">half</property>
              </object>
              <packing>
                <property name="left_attach">0</property>
                <property name="top_attach">0</property>
                <property name="width">1</property>
                <property name="height">1</property>
              </packing>
            </child>
            <child>
              <object class="GtkButton" id="button2">
                <property name="label" translatable="yes">Pause Copying</property>
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="receives_default">True</property>
                <property name="margin_left">40</property>
                <property name="margin_right">40</property>
              </object>
              <packing>
                <property name="left_attach">2</property>
                <property name="top_attach">0</property>
                <property name="width">1</property>
                <property name="height">1</property>
              </packing>
            </child>
            <child>
              <object class="GtkButton" id="button3">
                <property name="label" translatable="yes">Stop Copying</property>
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="receives_default">True</property>
                <property name="margin_left">40</property>
                <property name="margin_right">40</property>
              </object>
              <packing>
                <property name="left_attach">4</property>
                <property name="top_attach">0</property>
                <property name="width">1</property>
                <property name="height">1</property>
              </packing>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">True</property>
            <property name="padding">2</property>
            <property name="position">5</property>
          </packing>
        </child>
      </object>
    </child>
  </object>
</interface>

and JAVA file is

public class Main {
public static void main(String[] args) {

    Window w;
    Builder b;
    Gtk.init(args);
    b = new Builder();
    try {
        b.addFromFile("Mycopy.glade");
    } catch (FileNotFoundException | ParseException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    w=(Window) b.getObject("window1");
    w.showAll();
    Gtk.main();
    }
}

</code>
Rahul K Jha
  • 788
  • 9
  • 18
  • So, what is your question? –  Feb 08 '15 at 18:58
  • failed to start my application. – Rahul K Jha Feb 08 '15 at 19:07
  • That's not a question. –  Feb 08 '15 at 19:08
  • how to get rid of this exception and launch app . – Rahul K Jha Feb 08 '15 at 19:10
  • So, first we need to uncover what "too large" means: the size of the icon file is too large, or the size, or sizes, of the icons themselves is too large. What is the size of your icon file in bytes, and can you post an image of your icon file? Also, I'm referencing this documentation here: https://developer.gnome.org/gtk2/stable/GtkWindow.html. What version of Gnome are you running, if indeed you are running Gnome? –  Feb 08 '15 at 19:22
  • the size of icon file 38.7 KB. i am running ubuntu 14.04 64 bit. – Rahul K Jha Feb 08 '15 at 19:25
  • Taking a stepwise approach to solving the problem, then, swap out the contents of your current .png file with a file containing a single 16x16 image. Is your current .png file a sprite by any chance? –  Feb 08 '15 at 19:28
  • Thanks , After removing icon app started running but i wan't to add the icon so i will try after resizing. – Rahul K Jha Feb 08 '15 at 19:34
  • Excellent! We're making progress... –  Feb 08 '15 at 19:43

0 Answers0