EBK JAVA PROGRAMMING
9th Edition
ISBN: 9781337671385
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
expand_more
expand_more
format_list_bulleted
Question
Chapter 1, Problem 11PE
Program Plan Intro
Comments in Java
Program Plan:
- Import the JavaFx swing package to display the dialog box.
- Define the class “CommentsDialog”.
- Define the main method.
- Display the given statement in a dialog box.
- Show the given statement in Line comment, Block comment and Javadoc comments.
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
Exercise 3:
Write a Java program which creates two frames, each containing one button. When you execute the program only one JFrame will appear and when you click on its button it will disappear and the other JFrame will appear. If you click on the button of the second frame it will make it disappear and let the first frame appear. And so on...
This is using Java. I will apprecitte detalied comments, so I understand better the exercise/code.
Please help me with my assignment for computer science as I had all the dialog box pop up for me except for "Whew" what am I doing wrong? I am including with this message the coding block for the assignment.
import java.awt.event.*;import javax.swing.*;public class MouseWhisperer extends JFrame implements MouseListener {MouseWhisperer() {super("COME CLOSER");setSize(300,100);setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);addMouseListener(this);setVisible(true);}public void mouseClicked(MouseEvent e) { setTitle("OUCH"); }public void mousePressed(MouseEvent e) { setTitle("LET GO"); }public void mouseReleased(MouseEvent e) { setTitle("WHEW"); }public void mouseEntered(MouseEvent e) { setTitle("I SEE YOU"); }public void mouseExited(MouseEvent e) { setTitle("COME CLOSER"); }public static void main(String[] args) { new MouseWhisperer(); }}
Please advice.
Chapter 1 Solutions
EBK JAVA PROGRAMMING
Ch. 1 - Prob. 1RQCh. 1 - Prob. 2RQCh. 1 - Prob. 3RQCh. 1 - Prob. 4RQCh. 1 - Prob. 5RQCh. 1 - Prob. 6RQCh. 1 - Prob. 7RQCh. 1 - Prob. 8RQCh. 1 - Prob. 9RQCh. 1 - Prob. 10RQ
Ch. 1 - Prob. 11RQCh. 1 - Prob. 12RQCh. 1 - Prob. 13RQCh. 1 - Prob. 14RQCh. 1 - Prob. 15RQCh. 1 - Prob. 16RQCh. 1 - Prob. 17RQCh. 1 - Prob. 18RQCh. 1 - Prob. 19RQCh. 1 - Prob. 20RQCh. 1 - Prob. 1PECh. 1 - Prob. 2PECh. 1 - Prob. 3PECh. 1 - Prob. 4PECh. 1 - Prob. 5PECh. 1 - Prob. 6PECh. 1 - Prob. 7PECh. 1 - Prob. 8PECh. 1 - Prob. 9PECh. 1 - Prob. 10PECh. 1 - Prob. 11PECh. 1 - Prob. 12PECh. 1 - Prob. 1DECh. 1 - Prob. 1GZCh. 1 - Prob. 1CPCh. 1 - Prob. 2CP
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Full comments and a java language implementation are needed. Write some code so that your name is shown in red font inside a blue frame, then save the file.arrow_forwardPlease use Java to help me with the assignment below. The assignment: A microwave control panel has four buttons: one for increasing the time by 30 seconds, one for switching between power levels 1 and 2, a reset button, and a start button. Implement a class that simulates the microwave, with a method for each button. The method for the start button should print a message “Cooking for ... seconds at level ...”.arrow_forwardWrite a program that draws a fixed rectangle centered at (100, 60) with width 100 and height 40. Whenever the mouse is moved, display the message indicating whether the mouse pointer is inside the rectangle, as shown in Figure 9.32. To detect whether the pointer is inside a rectangle, use theRectangle2D class defined in Exercise 8.19.arrow_forward
- The Character class is provided in the Javalibrary. Provide your own implementation for this class. Name the new classMyCharacter.arrow_forwardmy homework problem Complete the code in the Practice class such that each time the user clicks the SUM button, the sum of the two valid integers will be shown in the lower right corner of the window (leave the user's input in the text fields). Here is a before and after view of the graphical user interface when the SUM button is clicked for the first time. 123 456 123 456 SUM SUM 579 import javax.swing.*; import java.awt.*; import java.awt.event.*; public class Practice { public static void main(String[] args) { JFrame frame = new JFrame("Add 2"); frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE); SumPanel panel = new SumPanel(); frame.getContentPane().add(panel); frame.setSize(140,80); frame.setVisible(true); } } class SumPanel extends JPanel { private JTextField op1Field; private JTextField op2Field; private JButton sumButton; private JLabel sumLabel; public SumPanel() { //Step 1; set up the layout setLayout(new GridLayout(2,2,4,4)); op1Field = new JTextField(); op2Field = new…arrow_forwardPlease help Read the description from the image down below and use Java to program Also please create a list of 26 CEO’S which includes there first name and last, the company they are the ceos of, and there salary’s all in one line like the example is the second photo Alsoarrow_forward
- Add a new Java class to your project by right clicking on the src folder in the Project pane and select New > Java Class.Enter Hours as the name for this class, and IntelliJ will add it to the files in the src folder for your project. Remember tocopy and insert the standard heading for the main method as you did for Program 2.Write a program that prompts the user to enter a number of hours, and produces the equivalent number of days as a wholenumber along with the number of hours left over. Assume that a day has exactly 24 hours. The following example showsthe format to use for your output, where the input entered by the user is underlined.Enter the number of hours: 100100 hours is 4 days, plus 4 hours.Define Variables: The number of hours will be a whole number, and we would like to obtain results as whole numbers ofdays and hours, so use the int data type to declare the variables to hold the numbers of hours input, as well as the results(the number of days and number of hours left…arrow_forwardTo indicate a single line comment in Java, we start the line with ___. # ** // ?arrow_forwardplss help me with my programming homework, thank u!Write a java program that will generate the given GUI with necessary operations ( +, -, *, /, and %). The output must look like in the image below.arrow_forward
- Please write the Java code for a Time class: Leave comments as explaination for how the code work, and finish the code. Code: import java.util.Scanner; class Main { publicstaticvoid main(String args[]) { Scanner scan = new Scanner(System.in); String timeString; int numMeetings; System.out.print("What time is it now? "); timeString = scan.nextLine(); Time.setCurTime(timeString); System.out.print("Current time: "); Time.showCurTime(); System.out.println(); System.out.print("How many meetings do/did you have today? "); numMeetings = scan.nextInt(); scan.nextLine(); // dispose of newline character } } /* Sample Output: What time is it now? 15:45 Current time: 15:45 How many meetings do/did you have today? 5 What time is meeting #1? 16:00 What time is meeting #2? 16:50 What time is meeting #3? 9:00 What time is meeting #4? 10:00 What time is meeting #5? 15:00 Here are the times for your meetings that are later today: 16:00 16:50 Your last meeting of the day is at 16:50 What…arrow_forwardI have already written the program and have it right, but I need help write print statement for the testorder class so that the display result looks as shown in the images. I am having trouble getting that right. I will paste the program below so you can run it and attatch the image of display result. Program for Order Class: package homework; import java.util.Date; public class Order { //Declare final variables public static final int ON_ORDER = 0; public static final int CANCELLED = 1; public static final int SHIPPED = 2; //Declare local variables private int totalOrder; private String orderName; private Date date; private int status; private String shippingAddress; private String phoneNumber; private String billingAddress; //Constructor public Order(String name) { this.totalOrder += 1; this.orderName = name; this.status = ON_ORDER; this.date = new Date();} //Cancel the placed order…arrow_forwardCan I get GUI code for this These is the buttons that you need to use // Button addd = new Button("A + B");Button sub = new Button("A - B");Button mul = new Button("A * B");Button dec = new Button("Dec");Button fac = new Button("x!");Button gcf = new Button("GCF"); // This is the code package prog2;import java.math.BigInteger;public abstract class Biginteger extends Frame {static BigInteger a;static BigInteger b;public Biginteger(BigInteger a, BigInteger b) {this.a = a;this.b = b;}@Overridepublic String toString() {return "Biginteger{" +"a=" + a +", b=" + b +'}';}//addition methodstatic BigInteger addbig(BigInteger a, BigInteger b){return a.add(b);}//subtraction methodstatic BigInteger subtract(BigInteger a, BigInteger b){return a.subtract(b);}//multiplication methodstatic BigInteger multiply(BigInteger a, BigInteger b){return a.multiply(b);}//division methodstatic BigInteger divide(BigInteger a, BigInteger b){return a.divide(b);}//modulous methodstatic BigInteger…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
The Top Down Approach to Software Development; Author: Christopher Kalodikis;https://www.youtube.com/watch?v=v9M8LA2uM48;License: Standard YouTube License, CC-BY