This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDialog

 
kalai sundar
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there nay methid to seticon fro Jdialog box. For eg, in case of JFrame, using setIcon method we will set the set incon, i want to set icon for the JDialong box, how i can do that, can anyone help me.


with regards
kalai
 
sayan maity
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cannot add icon to the JDialog. It does not support that as it has few predefined icons like question mark, exclamation etc. Instead you can declare one frame and use setIcon method on the frame. Attach whatever necessary buttons are required and actionlistener to those buttons.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
change the icon of the JFrame to the one you want in the dialog box, then

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic