Conversion.java
// import all required classes and interfaces
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
// create Conversion class which extends JFrame class
// and implements ActionListener interface
public class Conversion extends JFrame implements ActionListener {
// declare all required components
JLabel l;
JTextField t;
JButton b;
// constructor
public Conversion() {
super(); // calls super class constructor
// intantiate all declated components
l=new JLabel();
t=new JTextField(25);
b=new JButton("Calculate");
// setting bounds to all components
t.setBounds(10,15,100,25);
l.setBounds(110,15,100,25);
b.setBounds(10,40,200,28);
// add components into frame
add(t);
add(l);
add(b);
// setting action listener on button
b.addActionListener(this);
setLayout(null); // set layout as null
setSize(240,120); // set size of the frame
setVisible(true); // make frame visible
}
// override actionPerformed() method
public void actionPerformed(ActionEvent ae)
{
double nzd=Double.parseDouble(t.getText());
double hkd=nzd*5.5;
l.setText(" "+hkd);
}
public static void main(String[] args) {
new Conversion(); // anonymous object
}
}
Output
(b) Write a class Conversion containing the following methods: (i) constructor: which builds the frame shown...
Java language (a) Create a class HexEditor with a constructor which creates a 5x10 text area in a Frame. Also add a pull-down menu with a menu item "Load". Copy the class as the answer to this part. (b) Create another class TestHexEditor with a main() method which creates an object anEditor of the class HexEditor and displays the frame in part (a) using setVisible(true). Copy the class as the answer to this part. (c) Make changes to the class...
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...