• Post Reply Bookmark Topic Watch Topic
  • New Topic

JDialog and JLabel  RSS feed

 
Frederic Filiatrault
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's an easy one for you guys, I can't found it :

The JLabel just don't want to show up !


public class JWaitDialog extends JDialog implements Runnable {

public JWaitDialog(Frame parent, int x, int y)
{
super(parent,true);
getContentPane().add(new JLabel("Please wait..."));
setLocation(x,y);
setSize(150,50);

Thread t = new Thread(this);
t.start();
}

public void run()
{
this.setVisible(true);
}
public void close()
{
this.dispose();
}
}


thk in advance !
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I first saw your post I thought you might need to do

but your code works okay as is; I can see the label. Running with j2se 1.5 in win xp. Under what condition does it not work for you?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!