Solved

Changing icon image of JDialog.

Posted on 2000-04-01
1
779 Views
Last Modified: 2008-02-01
Hi,

How to change the icon image on the left handside of the title bar of a JDialog instance?

Thanks.

Bye,

Ajit.
0
Comment
Question by:ajit_kamat
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 19

Accepted Solution

by:
Jim Cakalic earned 50 total points
ID: 2676069
JDialog appears to inherit the titlebar icon image from its owner JFrame. You set a frame as the dialog owner by using the appropriate JDialog constructor. If your current JFrame already has the icon image your want (using setIconImage()), no problem. If not, you can create a dummy JFrame, set its image, and make this the owner of the JDialog.

JFrame dummyFrame = new JFrame();
ImageIcon icon = new ImageIcon( ....... );
dummyFrame.setIconImage( icon.getImage() );
JDialog dialog = new JDialog(dummyFrame, ...);

Best regards,
Jim Cakalic
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question