Dynamic home page with java JtabbedPane


Everybody wishes to have a nice and good looking interface that corrresponds to what he/she has done, as you learn with me i am going to show you how to generate a well looking interface for you.



1 
 2 package mobile.store.mgt.sys;
 3 
 4 import java.awt.*;
 5 import javax.swing.*;
 6 
 7 public class Homes extends JFrame {
 8 private JPanel northpan;
 9       private  JPanel centerpan;
10       private  JPanel pan;
11     public Homes() {
12         super("Login successful.... Welcome to Mobile Store Management System");
13         setSize(1200, 700);
14         setDefaultCloseOperation(EXIT_ON_CLOSE);
15         setLocationRelativeTo(null);
16         setLayout(new BorderLayout());
17       // getContentPane().setBackground(Color.black);
18         northpan = new JPanel();
19         centerpan = new JPanel();
20         add(northpan, BorderLayout.NORTH);
21         add(centerpan, BorderLayout.CENTER);
22          pan = new JPanel();
23         //JLabel labImg = new JLabel(new ImageIcon(getClass().getResource("loginImg.jpg")));
24         pan.setLayout(new GridLayout(1,7));
25         
26         centerpan.setLayout(new BorderLayout());
27         centerpan.add(pan, BorderLayout.NORTH);
28         
29       //  centerpan.add(labImg, BorderLayout.CENTER);
30 
31         JButton customerpan = new JButton("CUSTOMERS");
32         JButton supplierpan = new JButton("SUPPLIERS");
33         //JPanel itempan = new JPanel();
34         
35         JButton home = new JButton("HOME");
36         JButton purchasepan = new JButton("ITEMS PURCHASED");
37         JButton salespan = new JButton("SALES INVOICE");
38         JButton stockpan = new JButton("STOCK DETAILS");
39         JButton purchase_returnpan = new JButton("PURCHASE RETURNED");
40               JLabel titlelab = new JLabel("MOBILE STORE MANAGEMENT SYSTEM");
41         JLabel wekcomeNote = new JLabel("NOKIA SAMSUNG INFINIX TECHNO");
42 
43         // northpan.setLayout(new BorderLayout());
44         
45 
46         
47         
48        
49         northpan.add(titlelab, JLabel.CENTER);
50 
51         pan.add(home);
52         pan.add(purchasepan);
53         pan.add(salespan);
54        /// pan.addTab("ITEMS", itempan);
55         pan.add(customerpan);
56         pan.add(supplierpan);
57         
58         pan.add(stockpan);
59         pan.add(purchase_returnpan);
60         // pan.addTab("SEARCH", new JTextField());
61        // home.add(wekcomeNote);
62 
63         purchase_returnpan.setLayout(new GridLayout(3, 1));
64 
65       
66 
67         northpan.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
68         home.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
69        // itempan.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
70         pan.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
71         northpan.setBackground(new Color(0, 0, 150));
72         titlelab.setForeground(Color.red);
73         wekcomeNote.setForeground(Color.white.brighter());
74         pan.setForeground(Color.BLACK.darker());
75         pan.setBackground(Color.ORANGE);
76         centerpan.setBackground(Color.BLACK);
77        
78         
79 
80         titlelab.setFont(new Font(Font.MONOSPACED, Font.BOLD, 30));
81         wekcomeNote.setFont(new Font(Font.MONOSPACED, Font.BOLD, 20));
82         pan.setFont(new Font(Font.MONOSPACED, Font.ITALIC, 20));
83 
84         setVisible(true);
85 
86         
87           
88     }
89 
90     public static void main(String[] args) {
91         //  home hfh == new home();
92 
93         new Homes();
94 
95     }
96 }
97 

Comments