answersLogoWhite

0

How can create choice list in java?

User Avatar

Anonymous

12y ago
Updated: 8/18/2019

import java.awt.*;
import java.awt.event.*;
public class ChoiceOptionExample{
public static void main(String[] args) {
Frame frame=new Frame("Choice");
Label label=new Label("What is your Choice:");
Choice choice=new Choice();
frame.add(label);
frame.add(choice);
choice.add("ROSE");
choice.add("India");
choice.add("WELCOME");
frame.setLayout(new FlowLayout());
frame.setSize(250,150);
frame.setVisible(true);
frame.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);
}
});
}
}

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

Can you create a constructor for an interface in java?

NO, we cannot create a contructor for an interface in java.


Program for length of list in java?

Java's List interface defines the size() method, which can be used to retrieve the length of a list.


List out the version of java?

Running "java -version" will display the current version of Java.


How do you create setup of core java project?

how to create setup file in core java


What are the keywords not used in java?

You can find a list of Java keywords in the Wikipedia article "List of Java keywords". These keywords may not be used for variables or other user-defined names.


What is the best compiler can be used to create Java programs?

A Java compiler.


Why is it important to create a short list?

To aid in making choices. For example, if you have 100 applicants for a job, the best way to narrow your choice of candidate is to create a short list of people who have the best qualities.


What does the verify keyword do in Java?

"verify" is not a Java keyword. I believe the link, in related links, has the complete list of Java keywords.


What is javadoc?

write a java program to display "Welcome Java" and list its execution steps.


Who create Java and when?

James Gosling and his team at Sun Microsystems developed Java in the early 1990s. The language was officially released to the public in 1995. Java was designed to be simple, secure, portable, and object-oriented, making it one of the most popular programming languages in the world.


What three objects are necessary to create a GUI in Java?

A computer, keyboard and Java compiler.


How do you create master page in jsp?

how to create a master page in java