import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
public class winframe extends JFrame {
String program_title = "XYZ - MANAGER";
JLabel a = new JLabel();
JPanel b= new JPanel();
JButton c = new JButton();
JMenuBar menue = new JMenuBar();
String Headline_basics = "Datenblätter (Datasheets)";
String Headline_formulas = "Formelsammlungen";
String Headline_handbooks = "Handbücher (Handbooks)";
String Combo_manuals_aips [] = {
"XYZ_01-02-022_2014-10_4",
"XYZ_02-02-010_2014-08_3",
"XYZ_01-02-008_2014-07_6",
"XYZ_01-01-004_2014-07_4",
"XYZ_01-02-017_2013-11_4",
"XYZ_01-02-003_2013-06_7",
"XYZ_02-04-001_2013-05_6",
"XYZ_03-02-018_2012-12_4",
"XYZ_01-02-013_2011-01_3",
"XYZ_01-02-014_2010-04_3",
"XYZ_00-00-006"};
String Combo_manuals_aicraft_types [] = {
"XYZ",
"XYZ",
"XYZ",
"XYZ",
"XYZ",
"XYZ",
"XYZ",
"XYZ"};
String Combobox_manuals_helicopter [] = {
"XYZ_Handbook",
"XYZ_Handbook"};
String ComboBox_basics_aluminium [] = {
"3.0205",
"3.0255",
"3.1325",
"3.1645",
"3.3535",
"3.7025",
"AlCu4MgSi(A)",
"AlMn1",
"AlMnCu",
"AlZn4,5Mg1"
};
String ComboBox_basics_steel [] = {
"E155",
"E320",
"P235TR1",
"P265TR2",
"X6CrAl13",
"X2CrNiMo17-12-2",
"X6CrNiTi18-10"
};
String ComboBox_aerodynamics [] = {
"Aerodynamik XYZ",
"XYZ Handbuch",
"Berechnungen am Flügel"
};
// FRAME
public winframe(){
setTitle(program_title);
setSize(1200, 800);
setVisible(true);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setResizable(true);
setLayout(null);
setJMenuBar(menue);
//MENU_ONE
JMenu datei = new JMenu("Start");
menue.add(datei);
//MENU_TWO
JMenu view = new JMenu("Ansicht");
menue.add(view);
//MENU_TWO_DOWN
JMenuItem fullscreen = new JMenuItem("Vollbild");
view.add(fullscreen);
fullscreen.addActionListener( new ActionListener(){
@Override public void actionPerformed(ActionEvent e){
setExtendedState(JFrame.MAXIMIZED_BOTH);
}
});
//MENU_THREE
JMenu help = new JMenu ("Hilfe");
menue.add(help);
JMenuItem quit = new JMenuItem("Beenden");
datei.add(quit);
quit.addActionListener( new ActionListener(){
@Override public void actionPerformed( ActionEvent e){
System.exit(0);
}
});
JMenuItem feedback = new JMenuItem("Feedback senden");
help.add(feedback);
JMenuItem ueber = new JMenuItem("Info");
help.add(ueber);
JPanel sections = new JPanel ();
sections.setLayout(null);
sections.setBounds(5, 5, 270, 250);
add(sections);
JLabel title_sections = new JLabel (Headline_basics);
title_sections.setBounds(5, 5, 150, 25);
sections.add(title_sections);
title_sections = new JLabel("Aluminium");
title_sections.setBounds(5,40,100,25);
sections.add(title_sections);
JComboBox combobox_basics_aluminium = new JComboBox (ComboBox_basics_aluminium);
combobox_basics_aluminium.setBounds(110,40,150,25);
sections.add(combobox_basics_aluminium);
title_sections = new JLabel("Stahl");
title_sections.setBounds(5,70,100,25);
sections.add(title_sections);
JComboBox combobox_basics_steel = new JComboBox (ComboBox_basics_steel);
combobox_basics_steel.setBounds(110,70,150,25);
sections.add(combobox_basics_steel);
JPanel collections = new JPanel();
collections.setBounds(350, 5, 320, 200);
collections.setLayout(null);
add(collections);
title_sections = new JLabel (Headline_formulas);
title_sections.setBounds(5, 5, 150, 25);
collections.add(title_sections);
JButton math = new JButton("Mathematik");
math.setBounds(5,40,155,25);
collections.add(math);
math.addActionListener (new ActionListener(){
@Override public void actionPerformed( ActionEvent e){
getClass().getResourceAsStream("G:/XYZ-Manager/Generell.pdf");
}
});
JButton elektroTech = new JButton("Elektrotechnik");
elektroTech.setBounds(165,40,155,25);
collections.add(elektroTech);
JButton elektronik = new JButton("Elektronik");
elektronik.setBounds(165,70,155,25);
collections.add(elektronik);
JButton physik = new JButton("Physik");
physik.setBounds(5,70,155,25);
collections.add(physik);
JButton formelnMasch = new JButton("Formeln & Tabellen Maschinenbau");
formelnMasch.setBounds(5,100,315,25);
collections.add(formelnMasch);
JButton formelTech = new JButton("Formeln & Tabellen - Technische Mechanik");
formelTech.setBounds(5,130,315,25);
collections.add(formelTech);
JButton formelnElas = new JButton("Formelsammlung Elastizitäts- & Festigkeitslehre");
formelnElas.setBounds(5,160,315,25);
collections.add(formelnElas);
JPanel manuals = new JPanel();
manuals.setLayout(null);
manuals.setBounds(700,5,320,400);
add(manuals);
title_sections = new JLabel(Headline_handbooks);
title_sections.setBounds(5, 5, 200, 25);
manuals.add(title_sections);
title_sections = new JLabel("XYZ");
title_sections.setBounds(5,40,100,25);
manuals.add(title_sections);
JComboBox combobox_manuals_aips = new JComboBox(Combo_manuals_aips);
combobox_manuals_aips.setBounds(110,40,200,25);
manuals.add(combobox_manuals_aips);
title_sections = new JLabel("Flugzeugmuster");
title_sections.setBounds(5,70,100,25);
manuals.add(title_sections);
JComboBox combobox_manuals_aircraft_types = new JComboBox(Combo_manuals_aicraft_types);
combobox_manuals_aircraft_types.setBounds(110,70,200,25);
manuals.add(combobox_manuals_aircraft_types);
title_sections = new JLabel("Drehflügler");
title_sections.setBounds(5,100,100,25);
manuals.add(title_sections);
JComboBox combobox_manuals_helicopter = new JComboBox(Combobox_manuals_helicopter);
combobox_manuals_helicopter.setBounds(110, 100, 200, 25);
manuals.add(combobox_manuals_helicopter);
title_sections = new JLabel("Aerodynamik");
title_sections.setBounds(5,130,100,25);
manuals.add(title_sections);
JComboBox combobox_manuals_aerodynamics = new JComboBox(ComboBox_aerodynamics);
combobox_manuals_aerodynamics.setBounds(110,130,200,25);
manuals.add(combobox_manuals_aerodynamics);
JButton aerodyn = new JButton("XYZ Handbuch");
aerodyn.setBounds(5, 190, 305, 25);
manuals.add(aerodyn);
JButton maintenance = new JButton("XYZ Handbook 2008");
maintenance.setBounds(5, 160, 305, 25);
manuals.add(maintenance);
JButton dubbel = new JButton("XYZ Maschinenbau");
dubbel.setBounds(5, 360, 305, 25);
manuals.add(dubbel);
}
}