TestPlugin.java
Select all
import java.awt.*; import javax.swing.*; import java.awt.event.*; public class TestPlugin extends JApplet { private boolean secondMessage; public void init() { secondMessage = false; JButton btn = new JButton("Switch message"); Container c = getContentPane(); c.setLayout(new FlowLayout()); c.add(btn); btn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { secondMessage = !secondMessage; if (secondMessage) showStatus("This is our plugin test"); else showStatus("Hello, world!"); } }); } }