-
Java AWT Drawing rectangle, line and circle
The java.awt libraries are set of classes provided by Java in order to draw shapes on a window. The abbreviation AWT stands for Abstract Windowing Toolkit. Today, the library has been converted into a huge set of classes which allows the user to create an entire GUI based application. The visual appearance of these classes depends on the platform on which the application runs.
Date: 2019-08-17 View: 1520
-
Java Swing JFileChooser example
JFileChooser is a quick and easy way to prompt the user to choose a file or a file saving location. Below are some simple examples of how to use this class.
Date: 2019-08-17 View: 1520
-
Java Swing JOptionPane showInputDialog example
This is a review of the showInputDialog() method of JOptionPane Class. With this method we can prompt the user for input while customizing our dialog window. The showConfirmDialog returns either String or Object and can be called using the following combinations of parameters:
Date: 2019-08-17 View: 1520
-
Java Swing JOptionPane showOptionDialog example
The showOptionDialog method of JOptionPane is the Grand Unification of showConfirmDialog, showInputDialog and showMessageDialog.
Date: 2019-08-11 View: 1520
-
Java Swing Draw shapes dynamically example
In this article we create an application that randomly puts shapes on a JPanel. The user can choose between the different shapes our application supports as well as the amount that will be drawn. As a design decision our application can make circles and stars. You can download the example at the end of the article and experiment with more shapes, random colours, random sizes etc.
Date: 2019-08-11 View: 1520
-
Java Swing – Keep dialog window up
The most common (and simple) way to implement a dialog in our application is the JOptionPane class. In this article we will discuss how to “overwrite” the default behaviour of JOptionPane that closes the dialog window when the user clicks a JOptionPane-created button.
Date: 2019-08-11 View: 1520