Solved

Changing icon image of JDialog.

Posted on 2000-04-01
1
781 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses

623 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