Here is how to set notepad icon for JFrame in Swing. Yes, you heard it right. But is it simple. Dead simple. Just see it below. import j...
Read More
Home » Swing Hacks
Showing posts with label Swing Hacks. Show all posts
Showing posts with label Swing Hacks. Show all posts
Create An Advanced Chat Box In Java
The following example illustrates creating an advanced chat box in Java in Swing that detects whether the user is thinking or typing and...
Read More
How To Move An Undecorated Jframe?
The following example illustrates how to move an undecorated JFrame . As they don't move by default, we need to keep a component that a...
Read More
Double Titlebar For Jframe In Swing
Yeah! I am excited to share this, a silly thing, but weird. Here is how to set a double titlebar for JFrame in swing, one comes with a de...
Read More
How To Add Jcheckbox To Jbutton In Swing?
Yeah! Adding JCheckBox to JButton is really gonna be simple, nothing more than 4 lines of code. Yes, it is. I said it right!! You need to ...
Read More
How To Give Jcheckbox A Feel Of Button?
JCheckBox doesn't look like a JButton . Yes, of course, I do agree. But did you remember that JCheckBox is after all a sub-class of t...
Read More
Add Image Preview Pane To Jfilechooser
Let me show you how to add image preview pane to JFileChooser . This is very simple, you might be familiar with the code of showing an ima...
Read More
How To Place Jmenu At Center Of Jmenubar?
Till now, we have seen how to add JMenu to JMenuBar. Now, we'll be applying a simple hack that lets you place JMenu at the center of ...
Read More
How To Set Custom Image Cursor In Java?
Since time, it was my tiny dream to set my own custom image cursor for a swing component and now I am able to do that in a single line! W...
Read More
How To Set Default System Icons In Jfilechooser?
Here is how to set default system icon for files and directories in JFileChooser using the simple FileView . It's nothing more than...
Read More
How To Set Look And Feel Via Command Line?
Image Credit: lookandfeelcast.com Here is how you can set the look and feel of a GUI application via the command prompt. The command li...
Read More
Set Gradient For Caret In Jtextarea
You can even customize the caret in JTextArea and set gradient for it by extending the DefaultCaret class and overriding the paint() m...
Read More
Fade Effect For Jlabel Using Timer
Have you ever tried fading out a JLabel or a component from transparency to semi transparency and then to pure opacity. This is very simp...
Read More
Show Popup Hidangan On Jbutton Click
Have you ever wondered, showing a popup sajian when a button is clicked? Quite similar to the concept of menu buttons as created earlier...
Read More
Get Focus For Jtextfield In Jfilechooser In Nimbuslookandfeel
There is a problem, not to mention small or big, after all a persoalan in the JFileChooser with the NimbusLookAndFeel , my most favorit...
Read More
Creating Transparent Jpanel In Swing
It is a quite common question, "how to create transparent panels in swing" and if you think that the solution is critical and i...
Read More
Subscribe to:
Posts (Atom)