Playing with Swing Components

Description

Computer Programming (Java) Flashcards on Playing with Swing Components, created by desnunan on 29/03/2014.
desnunan
Flashcards by desnunan, updated more than 1 year ago
desnunan
Created by desnunan over 10 years ago
34
0

Resource summary

Question Answer
What is the syntax for making a JTextField? JTextField field = new JTextField(nColumns); JTextField field = new JTextField("your name");
What is the syntax for making a JTextArea? JTextArea text = new JTextArea(lines, columns);
What is the syntax for making a JCheckBox? JCheckBox check = new JCheckBox("Goes to 11");
What is the syntax for making a JList? JList list = new JList(listEntries);
What is the syntax to register for a JCheckBox item event? check.addItemListener(this);
What is the syntax to select or deselect a JCheckBox? check.setSelected(true); check.setSelected(false);
What syntax to use to restrict the user to selecting only ONE thing at a time in JList? list.setSelectionMode (ListSelectionModel. SINGLE_SELECTION);
What is the syntax to register for a JList list selection event? list.addListSelectionListener(this);
What is the method for handling a JCheckBox item event? public void itemStateChanged(ItemEvent ev) {..}
What is the method for handling a JList list selection event? public void valueChanged(ListSelectionEvent lse) {..}
What is the syntax for turning on line wrapping for a JTextArea object? text.setLineWrap(true);
Show full summary Hide full summary

Similar

Java Week 5 Object Oriented Programming
Troy Bowlin
Making a GUI
desnunan
Java Practice 1
Ummm No
PEGA CSSA Prep
Wendell Phipps
Getting a User Event
desnunan
Listener
desnunan
Paintable Widgets
desnunan
Handling Swing Component Events
desnunan
Make a JScrollPane
desnunan
Java Practice 2
Ummm No
Servion - Java Questionnaire
rohit.benedict