Question: This is a Java Programming 2 question for course INFO 1531 The code does not implement the UI or make it functional. How do I
This is a Java Programming 2 question for course INFO 1531
The code does not implement the UI or make it functional. How do I make it functional or implement the UI using Java Code in NETBEANS? Please provide the code I am missing/need and where to place it in my code. Thank you!
import java.awt.*; import javax.swing.*; import java.text.NumberFormat;
public class PizzaOrderFrame extends JFrame {
private JCheckBox anchoviesCheckBox; private JRadioButton largeRadioButton; private JRadioButton mediumRadioButton; private JRadioButton smallRadioButton; private JCheckBox mushroomsCheckBox; private JCheckBox olivesCheckBox; private JCheckBox pepperoniCheckBox; private JCheckBox salamiCheckBox; private JCheckBox sausageCheckBox; private JTextField priceTextField;
public PizzaOrderFrame() { try { UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) { System.out.println(e); } initComponents(); }
private void initComponents() { setTitle("Pizza Calculator"); setLocationByPlatform(true); setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
setSize(270, 280); }
// helper method for getting a GridBagConstraints object private GridBagConstraints getConstraints(int x, int y) { GridBagConstraints c = new GridBagConstraints(); c.anchor = GridBagConstraints.LINE_START; c.insets = new Insets(5, 5, 0, 5); c.gridx = x; c.gridy = y; return c; }
public static void main(String args[]) { java.awt.EventQueue.invokeLater(() -> { PizzaOrderFrame frame = new PizzaOrderFrame(); frame.setVisible(true); }); } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
