How does one show a message in a popup-window from an applet?
Location: http://www.jguru.com/faq/view.jsp?EID=56939 Created: Jun 8, 2000 Modified: 2000-06-08 02:02:57.833 Author: Paolo Rocca (http://www.jguru.com/guru/viewbio.jsp?EID=56889) Question originally posed by Svend-Aage Nielsen (http://www.jguru.com/guru/viewbio.jsp?EID=53075 Just popup a Frame from your applet. This is your applet: //File hello.java import java.awt.*; import java.applet.*; public class hello extends Applet { Frame f = new helloFrame (); public void init() { setLayout (new FlowLayout()); add (new Button(“Click me”)); /* this button allows you to pop up a frame */ } public boolean action (Event evt, Object arg) { if (arg.equals(“Click me”)) { f.show(); // Show the popup window f.resize (150, 100); // and resize it return true; } else return false; } } And this is your frame: // File helloFrame.java import java.awt.*; import java.applet.*; public class helloFrame extends Frame { public helloFrame() { setLayout (new FlowLayout()); setTitle (“Hello!”); // The window title a
Related Questions
- When I am in the program and have items in my cart and go to edit them with the shopping cart button I get the message: Applet JSC java.util.NoSuchElementException. How do I fix that?
- Can I get rid of the message "Warning:Applet Window" along the bottom of my popup windows in my Applet?
- Why does the applet display an error message with Netscape 3.x (or MSIE 3.x)?