Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class GUI extends JFrame {
- private JPanel contentPane;
- public static void main(String[] args){
- GUI g = new GUI(null);
- }
- public GUI(Applet a) {
- setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- setBounds(100, 100, 947, 539);
- contentPane = new JPanel();
- contentPane.setBackground(Color.DARK_GRAY);
- contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
- setContentPane(contentPane);
- setSize(900,450);
- setVisible(true);
- try {
- for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
- if ("Nimbus".equals(info.getName())) {
- UIManager.setLookAndFeel(info.getClassName());
- break;
- }
- }
- } catch (Exception e) {
- // If Nimbus is not available, you can set the GUI to another look and feel.
- }
- JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
- JPanel panel_1 = new JPanel();
- panel_1.setBackground(Color.ORANGE);
- //panel_1.add(a);
- GroupLayout gl_contentPane = new GroupLayout(contentPane);
- gl_contentPane.setHorizontalGroup(
- gl_contentPane.createParallelGroup(Alignment.LEADING)
- .addGroup(Alignment.TRAILING, gl_contentPane.createSequentialGroup()
- .addComponent(panel_1, GroupLayout.DEFAULT_SIZE, 764, Short.MAX_VALUE)
- .addPreferredGap(ComponentPlacement.RELATED)
- .addComponent(tabbedPane, GroupLayout.PREFERRED_SIZE, 160, GroupLayout.PREFERRED_SIZE))
- );
- gl_contentPane.setVerticalGroup(
- gl_contentPane.createParallelGroup(Alignment.LEADING)
- .addGroup(Alignment.TRAILING, gl_contentPane.createSequentialGroup()
- .addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING)
- .addComponent(panel_1, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 488, Short.MAX_VALUE)
- .addComponent(tabbedPane, GroupLayout.DEFAULT_SIZE, 497, Short.MAX_VALUE))
- .addGap(2))
- );
- //Image img = new ImageIcon(this.getClass().getResource("/lookup.png")).getImage();
- //Image img1 = new ImageIcon(this.getClass().getResource("/stats.png")).getImage();
- JPanel panel_2 = new JPanel();
- tabbedPane.addTab(null, null, panel_2, null);
- JPanel panel = new JPanel();
- tabbedPane.addTab(null, null, panel, null);
- JPanel panel_3 = new JPanel();
- tabbedPane.addTab("New tab", null, panel_3, null);
- contentPane.setLayout(gl_contentPane);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement