Complete the initUI() method with your codes to show that when we click on a button with
Fantastic news! We've Found the answer you've been seeking!
Question:
Complete the initUI() method with your codes to show that when we click on a button with label "Quit", the application terminates (this is not a complete program and that's fine).
public class QuitButtonEx extends JFrame {
public QuitButtonEx() {
initUI();
}
private void initUI() {
var quitButton = new JButton("Quit");
//add code to add action listener
//add code to create layout
//add code to set title "Quit button"
//add code to set size
//add code to set relative location
//write code to exit on close
}
Related Book For
A First Course In Mathematical Modeling
ISBN: 9781285050904
5th Edition
Authors: Frank R. Giordano, William P. Fox, Steven B. Horton
Posted Date: