answersLogoWhite

0

import javax.swing.*;

import java.awt.*;

import java.awt.event.*;

class jwp extends JFrame implements ActionListener{

JButton button = new JButton ("Submit");

JTextField field = new JTextField();

JLabel label = new JLabel("Enter your name : ",Label.RIGHT);

public jwp(){

super("JFrame with panel and button");

setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

JPanel panel = new JPanel(null);

panel.add(label);

panel.add(field);

panel.add(button);

setContentPane(panel);

button.setBounds(100,70,100,50);

label.setBounds(20,30,200,20);

field.setBounds(120,30,100,20);

button.addActionListener(this);}

public void actionPerformed (ActionEvent e){

if (e.getSource() ==button){

JOptionPane.showMessageDialog(this,"Youre name was "+field.getText());}

}

}

public class frame1 {

public static void main (String[] args) {

jwp start = new jwp();

start.setSize(300, 200);

start.setVisible(true);

}

}

that's alll.......i can't upgrade it anymore......

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

What is the written java code for a java program that stores and prints out the student's grade?

what likeint grade = new intgrade = 85System.out.println(grade);or more complicated? be more specific


Difference between a java complier and the Java JIT?

A java compiler takes Java source code and turns it into Java bytecode, which can then be run by the java virtual machine.Using JIT means that the java code will be compiled and executed at the time that you run the program, which will slow down the program because it has to compile the code at the same time that it runs.


In the first step of the Java hybrid compilation process Java program code is converted into an intermediate format called .?

Java byte code.


Why cant someone hack a Java program if they know the Java programming language?

Knowing Java does not allow you to hack a Java program because the source code is not available to hackers. Also, a program interprets the bit-code before you see it, so even with a decompiler, hacking the program will not be possible.


Why it is not possible to execute java program on machine which does not have JVM installed on it?

when a java program is compiled it is converted into a non executable code which is byte code, and this byte code can only be interpreted by JVM. so a java program can't be executed on a machine which doesn't have JVM installed on it.


What is a Javacode?

If someone talks about "Java code," then they're are most likely referring to the source code of a Java program.


What is a Java Drive-By?

AnswerA Java Drive-By is a Java Applet that is coded in Java and is put on a website. Once you click "Run" on the pop-up, it will download a program off the internet. This program can be a virus or even a simple downloader. If you'd like to get the source code or wanna know more information about a Java Drive-By, use Google.


What is JAVA drive by?

AnswerA Java Drive-By is a Java Applet that is coded in Java and is put on a website. Once you click "Run" on the pop-up, it will download a program off the internet. This program can be a virus or even a simple downloader. If you'd like to get the source code or wanna know more information about a Java Drive-By, use Google.


What is a Java Drive By?

AnswerA Java Drive-By is a Java Applet that is coded in Java and is put on a website. Once you click "Run" on the pop-up, it will download a program off the internet. This program can be a virus or even a simple downloader. If you'd like to get the source code or wanna know more information about a Java Drive-By, use Google.


What translates a Java program into Bytecode?

The Java Runtime Environment (JRE) converts the byte code to machine language.


It is not an error not to end a Java file name with the java extension?

If you want to compile a java program the name of that source code must end with extension .java


Why c program runs faster then java program?

The main reason for this is that C code compiles down to native machine code. Java bytecode needs to be run in the JVM, which may or may not compile it down to native code.