need help writing code to make this gui in java To review th

need help writing code to make this gui in java

To review the basics of user interfaces Directions Create an interface for a program that helps a group of people to calculate how much each of them owes for a restaurant meal that looks like the one below. The interface does not need to do anything in response to user clicks.

Solution

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class Gui extends JFrame implements ActionListener
{
public static void main(String [] args)
{
Gui g = new Gui();
}
Gui()
{
setVisible(true);
setLocationRelativeTo(null);
setSize(400,200);
Label hello = new Label(\"hello world\");
JTextField Total = new JTextField(\"\");
JTextField Tip_Perc = new JTextField(\"\");
JTextField No_of_ppl = new JTextField(\"\");
  
Label pays = new Label(\"Each Person Pays:\");
Label disc = new Label(\"<Enter the above information and press calculate>\");
setLayout(new FlowLayout());
add(hello);
add(Total);
add(Tip_Perc);
add(No_of_ppl);
add(pays); add(disc);
  
JButton calc = new JButton(\"Calculate\");
add(calc);
}
public void actionPerformed(ActionEvent e)
{
  
}
}

need help writing code to make this gui in java To review the basics of user interfaces Directions Create an interface for a program that helps a group of peopl

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site