Solved

Changing icon image of JDialog.

Posted on 2000-04-01
1
770 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
1 Comment
 
LVL 19

Accepted Solution

by:
Jim Cakalic earned 50 total points
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now