Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Other Java > Java GUI
|
Java GUI Discussions specific to programming Java GUI.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java GUI section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 13th, 2005, 04:11 AM
Registered User
 
Join Date: May 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default No text in Jdialog

Hi all
I am using a JDialog and set its undecorated property
i have to display some textual info in it ,but JLabel does not work..
Heres my piece of work:


JLabel myLabel =new JLabel();
JDialog jd= new JDialog() ;


myLabel = new JLabel("HELLO");
                                      jd.setSize(100,50);

                                     jd.getContentPane().add(myLabel);

                                     jd.setResizable( false );
jd.setUndecorated(true);

jd.setLocation((int)e.getX()+50,(int)e.getY());

 jd.show();




 
Old May 14th, 2005, 11:14 AM
Registered User
 
Join Date: May 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well, I don't know if it is the fact that you have
redefined the label object again or the fact that
the dialog does not have a parent container,
be it another dialog or a frame.
But the fllowing code should be changed.

JLabel myLabel = new JLabel()
myLabel = new JLabel("Hello")
to...
JLabel myLabel = new JLabel("Hello");
or..
JLabel myLabel = new JLabel();
myLabel.setText("Hello");

then.. try to give the JDialog a parent Conatiner.
like this...
JDialog jd = new JDialog(frame, "Title of dialog", true);

 
Old May 23rd, 2005, 02:26 AM
Registered User
 
Join Date: May 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

THANX
it worked
i m getting a purple back colored title bar on it.can i change it
as i am explicitely adding tooltip with Jdialog 's help(programming in ILOG ,its tooltip takes lot of time.).
can i remove the status bar of the Jdialog.
..






Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert Text(Sql Server Text Field) to Image(JPG) srinivas72 ADO.NET 2 February 13th, 2009 06:31 PM
JDialog hoop_12 Java GUI 0 April 20th, 2006 11:56 AM
Jdialog tabbed panes nady Java GUI 0 April 11th, 2006 12:52 PM
Titlebar on JDialog/JFrame raven983 Java GUI 4 May 7th, 2005 07:08 PM
Using JDialog to get values from user pratheeba Java GUI 1 October 9th, 2003 02:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.