Question

need help writing code to make this gui in java

C Home Ch x Check please CS-118 x D Microsoft Word Check x Microsoft Word-check please.docx 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. Check Divider Total: Tip Percentage: Number of People: Each person pays: KEnter the above information and press Calculate> Calculate

0 0
Add a comment Improve this question Transcribed image text
Answer #1

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)
{
  
}
}

Add a comment
Know the answer?
Add Answer to:
need help writing code to make this gui in java To review the basics of user...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Need help on following Java GUI problem: Write a program that lets a user display and...

    Need help on following Java GUI problem: Write a program that lets a user display and modify pictures. Create a window. Add four buttons so that clicking a particular button will shift the image by a small amount in the north, south, east or west direction inside the window. Add a menu bar with two menus: File and Image. The File menu should contain an Open menu item that the user can select to display JPEG and PNG files from...

  • I need help writing the code for a GUI calculator that uses 4 Radio Buttons (+....

    I need help writing the code for a GUI calculator that uses 4 Radio Buttons (+. -, * , /). Only one button can be selected at a time. I also have to group the buttons for this i am importing the ToggleGroup and using that. The user also need to select one function to begin with or an "Error" message will show if they select the calculate button. I would really like to know what needs to be used...

  • I need help with these java codingbat questions please: Create a method that creates a user...

    I need help with these java codingbat questions please: Create a method that creates a user id, where the user id is made up of the first letter of the first name and the entire last name. e.g. john smith ->jsmith getUserld("bill", "gates")-"bgates" getUserId("steve", "jobs")"sjobs" getUserId("larry", "page") -"lpage" Go Save, Compile, Run (ctrl-enter) public String getUserId( String firstName, String lastName) Given a number n, create an array with elements starting from 1 to n. e.g. 5 > getNumArray(1) [1] getNumArray...

  • I need to make javafx GUI application called Email that implements a prototype user interface for...

    I need to make javafx GUI application called Email that implements a prototype user interface for composing email message. The application should have labelled text fields for To, cc,bcc ,subject line, one for message body and button lebelled Send. When we click Send button, the program should print contents of all fields to standard output using println() statement. I am attaching photos of Email.java and EmailPane.java, I need to make it as per these classes CylinderSta.. Cylinder java MultiCylind.. ....

  • I need help writing this code for java class. Starter file: Project3.java and input file: dictionary.txt...

    I need help writing this code for java class. Starter file: Project3.java and input file: dictionary.txt Project#3 is an extension of the concepts and tasks of Lab#3. You will again read the dictionary file and resize the array as needed to store the words. Project#3 will require you to update a frequency counter of word lengths every time a word is read from the dictionary into the wordList. When your program is finished this histogram array will contain the following:...

  • I need this Program code made for Java please with the sample results. Echo Input from...

    I need this Program code made for Java please with the sample results. Echo Input from the Console to the Screen Using Methods Review the resources and instructions in the Discussion Prep Study before completing this discussion. For this discussion, you practiced using Java methods to echo input from the console to the screen. Create a Java program that reads in any value entered at the console and then prints it out to the screen. The program must have at...

  • the first question java code eclipse app the second question is java fx gui caculator please...

    the first question java code eclipse app the second question is java fx gui caculator please fast 1. Create project called "YourFirstName_QUID'. Eg. Aliomar_202002345 2. Create two package Q1 and Q2. 3. Add your name and studentID as comments on the top of each Java source file you submit. Question 1. Bookings APP [80 Points-six parts] Implement the following hotel booking system. Use the following class diagram to understand the structure of the system's classes, their attributes operations (or methods),...

  • In java language here is my code so far! i only need help with the extra...

    In java language here is my code so far! i only need help with the extra credit part For this project, you will create a Rock, Paper, Scissors game. Write a GUI program that allows a user to play Rock, Paper, Scissors against the computer. If you’re not familiar with Rock, Paper, Scissors, check out the Wikipedia page: http://en.wikipedia.org/wiki/Rock-paper-scissors This is how the program works: The user clicks a button to make their move (rock, paper, or scissors). The program...

  • could you please help me with this problem, also I need a little text so I...

    could you please help me with this problem, also I need a little text so I can understand how you solved the problem? import java.io.File; import java.util.Scanner; /** * This program lists the files in a directory specified by * the user. The user is asked to type in a directory name. * If the name entered by the user is not a directory, a * message is printed and the program ends. */ public class DirectoryList { public static...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT