Two Laptop Bag*
The moose likes Swing / AWT / SWT and the fly likes setting the size of 'JDialog' problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "setting the size of Watch "setting the size of New topic
Author

setting the size of 'JDialog' problem

Vikas Kumar Sahu
Ranch Hand

Joined: Dec 02, 2003
Posts: 59
Hi,
I m making jdialog,
I set its size, but it is not comming in my desired size
my code is -

public class ServiceRootInfoDialog extends NmDialog {
private JPanel serviceRootTableViewPanel = null;
private ControllerI nmMainFrame = null;
private NetworkElement ne = null;
public ServiceRootInfoDialog(JFrame frame, String title,
ControllerI nmMainFrame, NodeModelI node) throws HeadlessException {
super(frame, title, true);
this.nmMainFrame = nmMainFrame;
this.ne = (NetworkElement)node;
initComponent();
}
public void initComponent(){
serviceRootTableViewPanel = new JPanel();
// serviceRootTableViewPanel.setSize(new Dimension(700, 700));
this.getContentPane().add(serviceRootTableViewPanel);
this.setSize(new Dimension(700, 700));
pack();
setVisible(true);
}
Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2578

Just comment or remove pack line you have aftr setSize() code. Should work...
HTH,
- Manish
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: setting the size of 'JDialog' problem
 
Similar Threads
Adding JButton
Click button to close popup window
Some code about GUI
JTable In JTree
Creating and showing JFrame from another JFrame