Thursday, January 15, 2015

JAVAX SWING

Javax Swing Package

May 2014. The semester has ended and I received my grade in my Advanced C++ class, A. All my programs received the same top grades and took almost the same amount of time, over 24 hours for each assignment.
These hours actually include studying the new programming concepts applied in the program, because the only way to learn programming is to learn the concept and practice what you learned, almost immediately, in an actual program.
The program that probably took the most time is the program that used overloaded operators to add, subtract, multiply, and divide two fractions. The reason why it took a long time is that I also simplified the resulting fraction, even though it was not an explicit part of the requirements.
The program already met all the requirements, but I believe a fraction should be simplified. I tested the program with some test data and it worked well with these data. But when I changed a pattern to these data, I found the solution did not simplify that data. So I went to lunch and tried to work out the solution in a piece of paper, a white napkin. And I came back to write the code for the algorithm I wrote on the napkin. After a few more tweaking, all test data I’ve used before now returns the correct simplified fraction.
The next advanced programming class I will take is Advanced Java. So I have been reviewing what I learned last Summer 2013 in my first modern day programming class.
Java is now in its eight version and the Swing package is being replaced by JavaFX. JavaFX is not a package, but a platform software supported by the Java API. It has several packages used for graphical client applications.
Here is a program that uses the most common dialog boxes of the Swing package.
package John;
import javax.swing.*;
public class myClass {
  public static void main(String[] args) {
    String input = JOptionPane.showInputDialog("Please enter a floating point number:");
    double dollar = Double.parseDouble(input);
    JOptionPane.showMessageDialog(null, "You entered $" + dollar);
    System.exit(0);
  }
}
CYK:
What package does a class belong if the package name is not explicit?
What does FX mean in JavaFX?
What data type consists of constant identifiers?
Welcome to Java!
John Sindayen

No comments:

Post a Comment