Hallo.
Habe versucht dieses Applet in eine HTML Seite zu bauen :
Mit diesem HTML Code :
Es wwrd einfach nicht angezeigt.
lg
ehlr.
Habe versucht dieses Applet in eine HTML Seite zu bauen :
Java:
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JApplet;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JButton;
@SuppressWarnings("serial")
public class MakeApplet extends JApplet {
private JPanel hauptPanel;
private BorderLayout layout1;
private JButton button;
private JLabel label;
public void init(){
hauptPanel = new JPanel();
layout1 = new BorderLayout(1,1);
button = new JButton("Test");
label = new JLabel("null");
hauptPanel.setLayout(layout1);
hauptPanel.add(button, BorderLayout.PAGE_START);
hauptPanel.add(label, BorderLayout.CENTER);
add(hauptPanel);
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
label.setText("Test erfolgreich!");
}
});
}
}
Mit diesem HTML Code :
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test Applet "MakeApplet.java"</title>
<style></style>
</head>
<body>
<CENTER>
<applet archive="MakeApplet.jar" code="MakeApplet.class" width="200" height="200"></applet>
</CENTER>
</body>
</html>
Es wwrd einfach nicht angezeigt.
lg
ehlr.