I have created a class that extends JDialog and i just want to show this JDialog without any parent frames ...The JDialog is displaying but in in the exact size that i have mentioned..
Following is the code...kindly tell me what is wrong with the code..
import java.awt.*;
import javax.swing.*;
import java.awt.BorderLayout;
public class DialogueTest extends JDialog {
public DialogueTest() {
JPanel panel = new JPanel();
panel.setPreferredSize(new Dimension(0, 20));
getContentPane().add(panel, BorderLayout.NORTH);
panel.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 5));
JLabel lblNewLabel = new JLabel("PoolRunner");
panel.add(lblNewLabel);
JPanel panel_1 = new JPanel();
getContentPane().add(panel_1, BorderLayout.CENTER);
panel_1.setLayout(new BorderLayout(0, 0));
JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
panel_1.add(tabbedPane, BorderLayout.CENTER);
JPanel panel_2 = new JPanel();
tabbedPane.addTab("New tab", null, panel_2, null);
this.setSize(1000, 1000);
this.pack();
this.setVisible(true);
}
public static void main(String[] args) {
new DialogueTest();
}
}
--- Update ---
I got the solution...
Following codes were missing..
panel.setPreferredSize(new Dimension(500, 20));
...
...
tabbedPane.setPreferredSize(new Dimension(500, 300));