зеркало из https://github.com/mozilla/gecko-dev.git
First Checked In.
This commit is contained in:
Родитель
0ffb01e012
Коммит
4b5092860c
|
@ -0,0 +1,32 @@
|
|||
import java.awt.event.*;
|
||||
import java.applet.*;
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
public class TestApplet extends JApplet implements ActionListener
|
||||
{
|
||||
TestFrame tFrame;
|
||||
|
||||
public void init()
|
||||
{
|
||||
getContentPane().setLayout(new BorderLayout());
|
||||
TestPanel tPanel = new TestPanel();
|
||||
getContentPane().add("Center", tPanel);
|
||||
|
||||
Button showBtn = new Button("Show");
|
||||
showBtn.addActionListener(this);
|
||||
Panel bottomPanel = new Panel();
|
||||
bottomPanel.setLayout(new FlowLayout());
|
||||
bottomPanel.add(showBtn);
|
||||
getContentPane().add("South", bottomPanel);
|
||||
|
||||
tFrame = new TestFrame();
|
||||
}
|
||||
|
||||
public void actionPerformed(ActionEvent e)
|
||||
{
|
||||
tFrame.setVisible(true);
|
||||
// tFrame.dispose();
|
||||
}
|
||||
|
||||
}
|
Двоичный файл не отображается.
|
@ -0,0 +1,27 @@
|
|||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import javax.swing.*;
|
||||
|
||||
public class TestFrame extends JFrame implements ActionListener
|
||||
{
|
||||
public TestFrame()
|
||||
{
|
||||
Container pane = getContentPane();
|
||||
pane.setLayout(new BorderLayout());
|
||||
TestPanel tPanel = new TestPanel();
|
||||
pane.add("Center", tPanel);
|
||||
Button closeBtn = new Button("Close");
|
||||
closeBtn.addActionListener(this);
|
||||
Panel bottomPanel = new Panel();
|
||||
bottomPanel.setLayout(new FlowLayout());
|
||||
bottomPanel.add(closeBtn);
|
||||
pane.add("South", bottomPanel);
|
||||
pack();
|
||||
}
|
||||
|
||||
public void actionPerformed(ActionEvent e)
|
||||
{
|
||||
setVisible(false);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import javax.swing.*;
|
||||
|
||||
public class TestPanel extends JPanel
|
||||
{
|
||||
public TestPanel()
|
||||
{
|
||||
setLayout(new GridLayout(3,2));
|
||||
for(int ctr=1; ctr<=3; ctr++ )
|
||||
{
|
||||
add( new JLabel("Label " + ctr));
|
||||
add( new JTextField());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
<body>
|
||||
<embed
|
||||
TYPE = "application/x-java-vm"
|
||||
NAME = "TestApplet"
|
||||
PLUGINSPAGE = "http://www.mozilla.org/oji/"
|
||||
code="TestApplet.class"
|
||||
archive="TestApplet.jar"
|
||||
width="200"
|
||||
height="100"
|
||||
>
|
||||
</embed>
|
||||
</body>
|
Загрузка…
Ссылка в новой задаче