Home Answers Viewqa Swing-AWT Java Dialogs

 
 


morris
Java Dialogs
2 Answer(s)      3 years and 2 months ago
Posted in : Swing AWT

a) I wish to design a frame whose layout mimics the Firefox print dialog . (please you can go to Mozilla Firefox, click File, then Print- to see the diagram)None of the components actually have to do anything. It should just show me how to lay out components.


b) I wish to write an applet with a 60 column by 10 row text area that allows the user to type some text. It should have a button that clears the text area when it's pressed.

Thanks in advance
View Answers

April 6, 2010 at 5:26 PM


Hi Friend,

Try the following code:

b)

1) TextWindow.java

import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;

public class TextWindow extends Applet implements ActionListener {
TextArea area;
Button b;
Panel p;

public void init(){
area=new TextArea(10,60);
p=new Panel();
b = new Button("Reset");
b.addActionListener(this);
p.add(area);
p.add(b);
add(p);
}
public void actionPerformed(ActionEvent e){
area.setText(" ");
}
}

2)applet.html:

<html>
<body>
<h1>Java Applet Demo</h1>
<applet code=TextWindow.class width=500 height=400>
</applet>
</body>
</html>

Thanks









Related Pages:
Java Dialogs - Swing AWT
Java Dialogs  a) I wish to design a frame whose layout mimics...: Java Applet Demo Thanks  Hi Friend, a)Please visit the following links: http://www.roseindia.net/java/example/java/swing
JOptionPane - Simple Dialogs
Prev: none | Next: JOptionPane - More Dialogs Java: JOptionPane - Simple Dialogs Here are two useful static methods from javax.swing.JOptionPane that allow you to easily create dialog boxes for input and output. The Java API
JOptionPane - More Dialogs
Prev: JOptionPane - Simple Dialogs | Next: none Java: JOptionPane - More Dialogs Here are some more useful static methods from javax.swing.JOptionPane that allow you to ask the user to indicate a choice. ValueMethod
java
java  Write a Java application that can capture five or more numbers and returns the total of the numbers, the average and the difference between total and average using input dialogs
Popup dialog box in java
Popup dialog box in java  How to display popup dialog box in java... on your application due to some event. With the help of java swing toolkit, you can create popup dialog box. Java swing toolkit provide tow types of dialog box
The Dialog boxes
Java: Dialogs There are several ways to build dialog boxes: JOptionPane - Simple Dialogs This is a very easy way (one statement) to build simple... Creating Wizard Dialogs with Java Swing (http://java.sun.com
joptionpane - Java Beginners
joptionpane  Hi, I need to hide the joptionpane message dialogs. import javax.swing.*; import java.util.regex.*; public class ValidateJOptionPane { public static void main(String[]args){ String input
Java Swing
Java Swing      ... Java programs with a graphical user interface (GUI). There are many components... in providing interactivity to Java applications. Following are components which
Java Web Start and Java Plug-in
Java Web Start Enhancements in version 6  ... Java Web Start should check for updates on the web, and what to do when.... Prior to Java SE 6, In Java Web Start <offline-allowed> element
Java error dialog
Java error dialog       A Java dialog box is an independent sub window ... in understanding how to create an Error dialogs box using Swing JOptionPane.For
New Features of JAVA SE 6.
New Features of JAVA SE 6.   .... Changes in I/O This is a new feature added in Java SE 6, which has...; Java Web Start enhancements in version 6 The cache format of Java
Java Programming: Section 7.7
here if Java were available.) The three simple dialogs... Section 7.7 Frames and Dialogs APPLETS ARE A FINE IDEA... of a Web browser. In Java's Swing GUI library, an independent window
Java SE 6
Java SE 6       The latest news for the java programmers that the Sun MicroSystems has released the Java SE 6 on Monday December 11. So go
Catching Exceptions in GUI Code - Java Tutorials
at console the java event dispatch thread dies after this. Solution The Solution... ownerless dialogs. With this method, we can find the * currently visible frame
Java Notes: Table of Contents
Java Notes: Table of Contents Java Notes. These Java programming notes.... Java Basics. I've started writing a more coherent tutorial called Java... are done the way they are. Copyleft Java Notes
Java Programming: Section 10.2
files. They can create new files and can write data to files. In Java.... Standalone programs written in Java, however, have the same access to your files as any other program. When you write a standalone Java application, you can use
java
java  diff bt core java and java
java
java  what is java
JAVA
JAVA  how the name came for java language as "JAVA
java
java   why iterator in java if we for loop
java
java  explain technologies are used in java now days and structure java
java
java  different between java & core java
Wait Cursor - Java Tutorials
Wait Cursor 2003-03-06 The Java Specialists' Newsletter [Issue 065] - Wait... to the 65th edition of The Java(tm) Specialists' Newsletter, sent to 6077 Java... to handle the wait cursor and modal dialogs. Thanks Herman! Next week I
java
java  is java open source
java
java  what is java reflection
java
java   in java does not pointers concept but what is nullpointers in java?   nullpointer is a runtime Exception
java
what is the size of array in java ?  what is the size of array in java ? what is the mean of finalize in java
Containers
Java NotesContainers Top-level Containers - window, applet, dialog... container in Java 2. You can also set the content pane to a new JPanel... Dialogs. You will use these three types of top-level containers
Java Programming: Section 10.3
. With this in mind, the while loop in the algorithm can be written in Java... to look at a Java program that does the same thing. Many file operations... backup.dat. Command-line arguments can also be used in Java programs
java
java   What is ?static? keyword
java
java  RARP implementation using java socket
java
java  sample code for RARP using java
java
java  Does java allows multiline comments
Java
Java  how to do java in command prompt
java
java  give a simple example for inheritance in java
java
java  give a simple example for inheritance in java
java
java  why to set classpath in java
java
java  why to set classpath in java
java
java  why to set classpath in java
java
java  why to set classpath in java
java
java  Write a java code to print "ABABBABCABABBA
java
java  write a program in java to acess the email
java
java  send me java interview questions
java
java  how use java method
java
java  what are JAVA applications development tools
Java
Java   Whether Java is Programming Language or it is SOftware
java
java  is java purely object oriented language
java
java  why multiple inheritance is not possible in java
java
java  explain object oriented concept in java
java
java   difference between class and interface

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.