Link to home
Start Free TrialLog in
Avatar of a-1220
a-1220

asked on

How to create a non-resizable JDialog with icon

Hi all,
       The login screen of an application need to have a icon on the dialog's top left(left to the title). I am using JDialog for the login screen. If this JDialog is resizeble the dialoge automatically take the icon from its parennt window. But when it become non re-sizable this icon disappears. Can anybody suggest is there any way to display icon on the top left of a non resizable JDialoge?

Thanks in  advance.
Shimit
Avatar of stimpyjcat
stimpyjcat

What platform/window manager?

The only control you get over the JDialog icon is with the setIcon method.  This is probably preferable to relying on the parent component icon if you want a specific icon for your dialog.

Whether the dialog is resizable is irrelevant to Java when setting the frame's icon.  It is entirely possible, however, that your platform's window manager does things differently if the native window is not resizable; if that's the case, you'd have to reconfigure your window manager.

I have a non-resizable dialog for which the icon appears just fine under win32 (I've used setIcon).  The default window manager on RedHat 6.2 GNU/Linux, however, shows no icon for *any* window (the icon only shows up when the window is iconified).
if you are using windows 2000 / NT 4 u cant use nonresiseable JDialog with icon
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
- To be PAQ'ed and points NOT refunded
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

vemul
Cleanup Volunteer
ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial