Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training  
 

Java Dialogs

Ads

 
 

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

Ads









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
java
java  diff bt core java and java
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  what is 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
Java
Java   Whether Java is pure object oriented Language
JAVA
JAVA  how the name came for java language as "JAVA
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
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   What is ?static? keyword
java
java  RARP implementation using java socket
java
java  sample code for RARP using java
Java
Java  how to do java in command prompt
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  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