Expert answer:F to C

Expert answer:please use Eclipse Jee Oxygen and can you combine all the code to wordTOPICSGraphical User Interfaces (GUI)DESCRIPTIONCreate a Graphical User Interface (GUI-based) application that converts a temperature in Fahrenheit to Centigrade and vice verse. See picture below.Picture Discussion GUI-based ProgramA program that contains a Graphical User Interface (GUI) is called a GUI-based program. It uses GUI components for interfacing with the user.A GUI ComponentA GUI component is a visual component that a user can use for communicating with the program . Buttons, text fields, menus, drop-down lists etc are all examples of GUI components.GUI ObjectInternally, each GUI component is a program object. For example, two buttons displayed above are internally two JButton objects. Similarly, other GUI components above are also objects of Java classes such as JPanel, JTextField, JLabels, etc.Difference Between a GUI Object and Non-GUI ObjectBoth a GUI Object and a non-GUI object have internal representations consisting of its field values and methods. However a GUI Object additionally has an external representation that a user can visually see. The Java runtime keeps the two representations always in synch. For example, each GUI program starts by displaying a window. This window is an external representation of an internal JFrame object. When the user changes the width of a JFrame window visually by clicking and dragging the mouse, the internal value of the field named “width” also changes accordingly. Similarly, when the program changes the value of field named “width” by calling the method setWidth, the external width of the JFrame window also changes accordingly. The two representations always stay in synch.Creating a GUI programYou can create a GUI program by creating an object of JFrame. However, this program would have minimal functionality. In creating a practical GUI program, we extend the JFrame class using inheritance and then add functionality to it. Then we create an object of extended JFrame class and display the extended JFrame object.Content PaneIn creating a GUI-based program, the programmer first extends the JFrame class. Then, in its constructor, the programmer creates a main JPanel object and puts all the needed GUI in it. Then the programmer makes the main JPanel as the content pane. When the main JPanel is made into a content pane, all the GUI in it becomes the GUI of the running program. (Note that the main JPanel may contain other JPanels which may contain GUI objects. Above, the main JPanel object contains three JPanel objects. Each of which contain other GUI objects). Creating A GUI program. Creating a GUI program involves the following:JFrameExt classCreate a class that extends JFrame (e.g JFrameExt). In the constructor of this class, create the GUI as below:Create a main JPanelMake the main JPanel as the content pane of the extended JFrame objectCreate a layout object (such as GridLayout, FlowLayout or BorderLayout object).Set the layout of the main JPanel by passing it the above layout objectAdd GUI components to the main JPanel object by calling its add method.Register the extended JFrame object as a listener with GUI components (such as JButton object) from which you want to receive events.Write an event handler in extended JFrame for receiving the events (e.g. event handler actionPerformed).TestJFrameExt class Create another class containing the main method (e.g. TestJFrameExt class). In the main method, do the following:Create an object of extended JFrame class created above (use new to create the object).Set the size of the extended JFrame. (by calling its method setSize)Make the JFrame visible (by calling its method setVisible)Note that when you create the JFrameExt, its constructor is called which creates its GUI. So when the main method shows the JFrameExt object, you will see the GUI. Synchronous I/OIn this type of I/O, the program initiates input/output activity and is called Synchronous I/O. For example when you use showMessageDialog and showInputDialog methods of the class JOptionPane for input and output.Asyncronous I/O or Event Driven I/OIn this type of I/O, the user initiates the input/output activity and is called Asynchronous I/O or Event Driven I/O. For example, the user may initiate I/O by clicking on a button or by selecting a menu item. In this type of I/O, each time user initiates an I/O activity, the system creates an event. The program responds to the event by invoking an event handler. GUI Programs All GUI based programs use Event Driven I/O. For example, when the user selects a menu item such as Open File, it results in an event. This event results in invoking a method (event handler) in the program that responds to the user request. Thus a GUI program is made up of a number of event handling methods which are invoked to handle specific events.Sample Codeimport java.awt.*;import java.awt.event.*;import javax.swing.*;public class JFrameExt extends JFrame implements ActionListener{private JPanel jpMain = new JPanel();private JPanel jpFrom = new JPanel();private JPanel jpTo = new JPanel();private JPanel jpOp = new JPanel();private JLabel jlbFrom = new JLabel(“From”);private JLabel jlbTo = new JLabel (“To “);private JTextField jtfFrom = new JTextField(10);private JTextField jtfTo = new JTextField(10);private JButton jbtFtoC = new JButton(“FtoC”);private JButton jbtCtoF = new JButton(“CToF”);public JFrameExt (){ setTitle (“Converter”); setSize(400, 200); setVisible(true);//set jpMain layout GridLayout gl = new GridLayout (3,1);jpMain.setLayout(gl);//add panels to jpMainjpMain.add(jpFrom);jpMain.add(jpTo);jpMain.add(jpOp);jpFrom.setBackground(Color.red);jpTo.setBackground(Color.green);jpOp.setBackground(Color.magenta);//Make jpMain as the content panethis.setContentPane(jpMain);//add components to panelsjpFrom.add(jlbFrom);jpFrom.add(jtfFrom);jpTo.add(jlbTo);jpTo.add(jtfTo);jtfTo.setEditable(false);jpOp.add(jbtFtoC);jpOp.add(jbtCtoF);//register this object as a listener with buttonsjbtFtoC.addActionListener(this);jbtCtoF.addActionListener(this); }//Listener methodpublic void actionPerformed(ActionEvent ev) { String sFrom,sTo;double dFrom, dTo; sFrom = jtfFrom.getText().trim(); dFrom = Double.parseDouble(sFrom);if (ev.getSource()==jbtFtoC){ dTo = 5.0/9.0 * (dFrom – 32.0); sTo = “” + dTo;jtfTo.setText(sTo); }else if (ev.getSource()==jbtCtoF){ dTo = (9.0/5.0 *dFrom) + 32.0; sTo = “” + dTo;jtfTo.setText(sTo); } }}

How it works

  1. Paste your instructions in the instructions box. You can also attach an instructions file
  2. Select the writer category, deadline, education level and review the instructions 
  3. Make a payment for the order to be assignment to a writer
  4.  Download the paper after the writer uploads it 

Will the writer plagiarize my essay?

You will get a plagiarism-free paper and you can get an originality report upon request.

Is this service safe?

All the personal information is confidential and we have 100% safe payment methods. We also guarantee good grades

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more

Order your essay today and save 20% with the discount code ESSAYHELP