Programming Examples

Are you a Programmer or Application Developer or a DBA? Take a cup of coffee, sit back and spend few minutes here :)

Swing

Radio JToggleButton Example

Radio JToggleButton Example

In this example, we have seven JToggleButton components. First 4 is for the Nationality and second three is for the Sex. Here, these toggle buttons act like a radio button. One can also note that there are two groups here. In a group, only one toggle button can stay in Switched ON state. The above picture shows France and Female is in Selected State. Now, we will implement this example.

Continue Reading →

JButton Rollover Image

JButton RollOver Icon

In the example below, we have three Java Swing JButtons. All these buttons display a normal image when the JFrame displays. Each button will display three image icons based on the mouse action. The images for Normal, button pressed and mouse-enter are shown in the above screen. Let us proceed with the example and start coding.

Continue Reading →