1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
import java.awt.*; import java.awt.event.*; import javax.swing.*;
public class TabbedPane extends JPanel{
ImageIcon icon = new ImageIcon("alert.gif"); ImageIcon icon1 = new ImageIcon("alert1.gif"); JTabbedPane t = new JTabbedPane();
public TabbedPane() { t.addTab("Fire Incident Report Form", icon, new Fire_Incident(), "Fire Incident Report Form"); t.setSelectedIndex(0); t.addTab("EMS Incident Report Form", icon, new EMS_Incident(), "EMS Incident Report Form"); t.addTab("Personnel Training Report Form", icon, new Training(), "Personnel Training Report Form"); t.addTab("Hydrant Report Form", icon, new Hydrant(), "Hydrant Report Form"); t.addTab("Staff Details Form", icon, new Staff(), "Staff Details Form"); t.addTab("Assets Management (Apparatus & Maintenance) Form", icon, new Assets(), "Asset Management (Apparatus & Maintenance) Form"); t.addTab("Assets Management (Inventory) Form", icon, new Inventory(), "Asset Management (Inventory) Form"); t.addTab("Assets Management (Vehicle) Form", icon, new Vehicle(), "Asset Management (Vehicle) Form"); t.addTab("Operations Roster Form", icon, new Duty(), "Operations Roster Form"); //Add the tabbed pane to this panel. setLayout(new GridLayout(1,1)); add(t); }
public static void main(String[] args) { JFrame f = new JFrame("F.L.A.M.E. Forms"); f.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) {System.exit(0);} }); f.getContentPane().add(new TabbedPane(),BorderLayout.CENTER); f.setSize(1024,768); f.setLocation(0,0); f.setVisible(true); } } |