Share on Google+Share on Google+

morris
Java Dialogs
2 Answer(s)      7 years 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

Ads

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 Tutorials/Questions & Answers:
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
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
Advertisements
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
Message Box Java
Box"); } } } Resource: Java Message Box Show Dialog Box in Java - Swing Dialogs Show Message and Confirm Dialog Box...In this section we will create a message box in Java using a Java API class
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 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
java  diff bt core java and java
java
java  what is java
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
java  different between java & core java
java
java  explain technologies are used in java now days and structure java
java
java   why iterator in java if we for loop
Java
Java   Whether Java is pure object oriented Language
JAVA
JAVA  how the name came for java language as "JAVA
java
java  what is java reflection
java
java  is java open source
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
java
java   in java does not pointers concept but what is nullpointers in java?   nullpointer is a runtime Exception
java
java  write a java program using filenotfoundexception
Java
Java  how to draw class diagrams in java
java
java   difference between class and interface
java
java  why multiple inheritance is not possible in java
java
java  explain object oriented concept in java
java
java  is java purely object oriented language
Java
Java   Whether Java is Programming Language or it is SOftware
java
java  what are JAVA applications development tools
java
java  how use java method
java
java  send me java interview questions
java
java  write a program in java to acess the email
java
java  Write a java code to print "ABABBABCABABBA
Tutorials   
Java Spring Hibernate Struts Training Change JPanel background color from mouse entered/exit event JTable Pagination Jcombobox JAVA SWING how can i display a pdf file in a jtextarea Crop Image Code in Applet Crop Image Code in Applet Image Manipulation in Swing AWT Applet Ho to get virtual key code. how to show set of images continously using JScrollpane in java how to show set of images continously using JScrollpane in java How to connect on screen keyboard to system. How to connect on screen keyboard to system. query java client server program for playing video file(stored in folder in the same workspace) using swings java client server program for playing video file(stored in folder in the same workspace) using swings java client server program for playing video file(stored in folder in the same workspace) using swings java client server program for playing video file(stored in folder in the same workspace) using swings Download. how to open one Jframe from main method call Urgent requirement display shapes i am getting an error in adding a menu item to a menu. I am trying to develop a Image Sliding application but unfortunately its not working... Can any one help me in this Sliding window protocol how to update the value of jslider how to update the value of jslider how to update the value of jslider how to update the value of jslider how to update the value of jslider Jbutton in JTable cells program code java textfield problem swing retrieve data from database in java swing form using prev n next buttons retrieve data from database in java swing form using prev n next buttons How to close a frame on action event of a button from a different class ? searching the data swings for webnms Jpanel allignment pass data from java frame to file code for traffic control system simulation Bank Management System how to maKE Jcombox editable after saveing value init. i havei) aJTextField and one button. when place the cursor or enter anything in the test field then only button should be enabled.by default the button should be disabled. i havei) a jtable with few cloumns and few rows andii) one button. when place the cursor in any of the table's column cell. i need to enable the button.by default the button should be disabled. PDF Comparator i have JTextfield and JComboBox. there are several values in combobox.when i select a value from combobox how to make textfiled as a combobox. issue on jcombobox

Ads

 
Advertisement null

Ads