This discussion is archived
1 Reply Latest reply: May 27, 2013 11:30 PM by r035198x RSS

remove the icon on a jdialog whick has a owner

1010009 Newbie
Currently Being Moderated
JFrame frame = new JFrame();
frame.setIcon("aaa.ico");
JDilaog dialog = new JDialg(frame, "dialog" , true);

so the dialog has its owner frame, which is neccessary
but i want the dialog has another icon ,or remove the icon on the dialog
how may i do ?
  • 1. Re: remove the icon on a jdialog whick has a owner
    r035198x Pro
    Currently Being Moderated
    They both have the setIconImage method so just set different images for each before showing them
      frame.setIconImage(ImageIO.read(Test.class.getResourceAsStream("someImage.jpg")));
      JDialog dialog = new JDialog(frame, "dialog" , true);
      dialog.setIconImage(ImageIO.read(Test.class.getResourceAsStream("anotherImage.jpg")));

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points