Home » Tag Archives: Swing (page 2)

Tag Archives: Swing

Transparent JFrame using JNA

java-duke-logo

In Make JFrame transparent I had shown a way to making frame’s transparent using AWTUtilities class. But using that class results in access restriction compile time error, resolution in Eclipse is also shown in that post. Now here is the version using java natives. I have used Java Native Access (JNA) library to call native functions to get the things ...

Read More »

Make JFrame transparent

java-duke-logo

First create a frame that has a slider in it which will be used to set transparency amount. import javax.swing.JFrame; import javax.swing.JSlider; public class TransparentFrame extends JFrame { public TransparentFrame() { setTitle('Transparent Frame'); setSize(400,400); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JSlider slider = new JSlider(JSlider.HORIZONTAL); add(slider); setVisible(true); } public static void main(String[] args) { new TransparentFrame(); } } Output of this will be: Now add ...

Read More »

Integrating JavaFX and Swing

javafx-logo

I’ve just finished rewriting a component of my app that was using Swing and now is using JavaFX, I’ve ended up with a JavaFX component that integrates with the larger swing app. It is a large app and the rewrite took me a while, in the end everything worked fine and I’m glad I did it. Reasons you might want ...

Read More »

Chat bubble in Java Swing

java-duke-logo

This article will explain you “how to draw chat bubble in java swing application?” Chat bubble is same as call-out or thought bubble. Today most of the chat application is showing conversion in this format, so this article will help you to do the same in desktop application made in java swing.           Following class is ...

Read More »

Java GUI Application Shutdown Gotcha

java-duke-logo

In recent times I’ve had issues with one or two Java GUI application not shutting down when I close them. They seem to stay around as a process, consuming computer resources. Today I got to the bottom of the problem and it’s a bit of a nasty gotcha which I wasn’t aware of before so I thought I would share ...

Read More »

Java Swing to Android

android-logo

Here is a quick, brief 10,000ft overview/observations on Android from a Swing developers point of view. Firstly if your coming to Android from Swing you are approaching it with a big advantage to J2EE developers. Now I realise Android doesn’t actually have the AWT/Swing API’s but that doesn’t matter as the general front end/event driven mechanism in it is so ...

Read More »

Java Swing Tic-Tac-Toe

java-duke-logo

Hello people! Wow its been a while since I posted something here…! I must say I really miss writing stuff and I promise I wont get into a ‘writer’s block’ again. Hopefully .. A helluva lot of things happened in the last two months and I’ve got loads to say. But in this post Im just gonna publish a small ...

Read More »

Graphics Tutorial

java-duke-logo

As we all know that we can make games with the help of java libraries that provide us with the graphics needed for making them. So today I will be starting a very new section on Java Graphics. I had earlier made posts on How to make an income tax calculator. To start with here are some prerequisites : -You ...

Read More »

Integrating JavaFX 2.0 with Swing and SWT

javafx-logo

One of the improvements in JavaFX with JavaFX 2.0 has been greater ease of interoperability with Swing and SWT. Several online resources document how this is done. These include Integrating JavaFX into Swing Applications and SWT Interop. However, in a nice example of effective class-level Javadoc documentation, the respective JavaFX classes javafx.embed.swing.JFXPanel and javafx.embed.swt.FXCanvas each provide a simple code sample ...

Read More »

Sometimes in Java, One Layout Manager Is Not Enough

java-duke-logo

Most often when developing Java Swing applications, we need to use several layout managers in several nested panels. This is usually not a problem and is considered the normal practice for all UI development in almost all languages known to man. However, most often for each panel in the UI only one layout manager is needed to achieve the desired ...

Read More »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.