public class Main extends JFrame implements ActionListener, WindowListener
{
JEditorPane pane;
JPanel panel;
TextField t;
Button s,d;
public void setVisible(boolean b) {
}
public static void main(String args[] )
{
Main Fenster1 = new Main();
Fenster1.setSize(500, 300);
Fenster1.setLocation(250, 200);
Fenster1.setTitle("<<<<Hilfe Menü>>>>");
Fenster1.setResizable(false);
Fenster1.show();
}
// JLabel l = new JLabel("Standard-Label");
public Main()
{
Calendar cal = Calendar.getInstance();
SimpleDateFormat formater = new SimpleDateFormat();
MenuBar hauptMenue = new MenuBar();
Menu menue1 = new Menu("Einführung");
//Menu...
// .
// .
hauptMenue.add(menue1);
hauptMenue.add(menue2);
hauptMenue.add(menue3);
hauptMenue.setHelpMenu(menue4);
hauptMenue.add(menue5);
setMenuBar(hauptMenue);
menue1.addActionListener(this);
menue2.addActionListener(this);
menue3.addActionListener(this);
menue4.addActionListener(this);
menue5.addActionListener(this);
addWindowListener(this);
this.pane = new JEditorPane("text/html","<html><body><head></head>
<center>" +
"[img]H:/java/üben/logo.jpg[/img]" +
"
<font face='Arial' size='22' Color='green'>SIMCOAT Hilfe</font>
" +
"
Version: 0.1</center>
</body></html>");
this.pane.setVisible(true);
getContentPane().add(pane); //Logo anzeigen
this.panel = new JPanel();
this.panel.setVisible(false);
getContentPane().add(panel);
JScrollPane scrollPane = new JScrollPane(pane);
add(scrollPane, BorderLayout.CENTER);
}
public void actionPerformed(ActionEvent evt)// von hier bis unten zu dem strich funktioniert was nicht-------------
{
if (evt.getActionCommand().equals(" Löschen "))
{
t.setText(" ");
}
else if (evt.getActionCommand().equals(" Suchen "))
{
String inhalt = t.getText();
if (inhalt.length() == 0)
{
/*Frame dia = new Frame();
dia.setSize(200,100);
dia.setLocation(200,150);
dia.setTitle("Meldung");
dia.show();*/
System.out.println("es steht nichts drine");
}
else
{
System.out.println("es steht was drine");
}
}//----------------------------------------------------------------------------------------------------------------
//suchen();
if (evt.getSource() instanceof MenuItem)
{
String menuAdd = evt.getActionCommand();
System.out.println(menuAdd);
if (menuAdd == "beenden")
{
System.exit(0);
}//----------------------------------------------------------------
//Einlesen Html-Seiten
else if(menuAdd.equals("Bauteilverarbeitung"))
{
bauteilverarbeitung();
}//----------------------------------------------------------------
//nächste Seite
else if(menuAdd.equals("Menü einstellung"))
{
einstellung();
}//---------------------------------------------------------------
//nächste Seite
else if(menuAdd.equals("Menü Ergebnisdarstellung"))
{
ergebnissdarstellung();
}//----------------------------------------------------------------
//nächste Seite
else if(menuAdd.equals("Vorraussetzungen"))
{
vorraussetzung();
}//----------------------------------------------------------------
//nächste Seite
else if(menuAdd.equals("Installation Java"))
{
installation();
}//----------------------------------------------------------------
//nächste Seite
else if(menuAdd.equals("Installation Java 3D"))
{
javaD();
}//----------------------------------------------------------------
else if(menuAdd.equals("Einführung"))
{
einfuhrung();
}//----------------------------------------------------------------
//<<<<<<Suchformular
else if(menuAdd.equals("Suchen"))
{
suchenformular();
}//----------------------------------------------------------------
else
{
String htmlContent = "<html><body>" + menuAdd + "<body></html>";
//this.text.setText(htmlContent);
this.pane.setText(htmlContent);
}
}
}
public void windowClosing(WindowEvent evt)
{
System.exit(0);
}
public void windowOpened(WindowEvent evt){}
public void windowIconified(WindowEvent evt){}
public void windowDeiconified(WindowEvent evt){}
public void windowClosed(WindowEvent evt){}
public void windowActivated(WindowEvent evt){}
public void windowDeactivated(WindowEvent evt){}
private void suchenformular() {
panel.setLayout(null);
this.pane.setVisible(false);
this.panel.setVisible(true);
Button s = new Button (" Suchen ");
s.setBounds(200,50,50,25);
s.setForeground(Color.BLUE);
s.setBackground(Color.WHITE);
// s.addActionListener(this);
this.panel.add(s);
Button d = new Button (" Löschen ");
d.setBounds(250,50,50,25);
d.setForeground(Color.ORANGE);
d.setBackground(Color.WHITE);
d.addActionListener(this);
this.panel.add(d);
Label l = new Label ("Search Word: ");
l.setBounds(100,30,100,15);
this.panel.add(l);
TextField t = new TextField();
t.setBounds(200,30,200,20);
t.addActionListener(this);
this.panel.add(t);
}
}