This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setting the size of 'JDialog' problem

 
Vikas Kumar Sahu
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2591
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just comment or remove pack line you have aftr setSize() code. Should work...
HTH,
- Manish
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic