Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class PanelWLabels {
- private JFrame frame;
- /**
- * Launch the application.
- */
- public static void main(String[] args) {
- EventQueue.invokeLater(new Runnable() {
- public void run() {
- try {
- PanelWLabels window = new PanelWLabels();
- window.frame.setVisible(true);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- });
- }
- /**
- * Create the application.
- */
- public PanelWLabels() {
- initialize();
- }
- /**
- * Initialize the contents of the frame.
- */
- private void initialize() {
- frame = new JFrame();
- frame.setBounds(100, 100, 450, 300);
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
- frame.getContentPane().add(tabbedPane, BorderLayout.CENTER);
- JScrollPane scrollPane = new JScrollPane();
- tabbedPane.addTab("New tab", null, scrollPane, null);
- JPanel panel = new JPanel();
- scrollPane.setViewportView(panel);
- panel.setLayout(new MigLayout("", "[][][][][][]", "[][][][]"));
- JLabel label = new JLabel("New label");
- panel.add(label, "cell 0 0");
- JLabel lblNewLabel_1 = new JLabel("New label");
- panel.add(lblNewLabel_1, "cell 5 1");
- JLabel lblNewLabel = new JLabel("New label");
- panel.add(lblNewLabel, "cell 2 3");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement