To set the background image on JFrame, there is no such direct methods as setBackground(). So we have to build our own interfaces to do that. Here is an example which uses the JPanel swing component to set the Background Image.
Click here to view the code
or
Click here : JFrameBackgroundImage
Fig : shows the screen when you run the above code. you need to have an image named "image.jpg" for the background image to be placed in the same directory/folder where the class file resides.
Tuesday, March 25, 2008
Setting the Background Image on JFrame
Labels:
JFrame Background Image
Thursday, March 20, 2008
A simple program illustrating how to create a swing type frame and how to draw a string above it.
Sample Screen Shot
Click here to view the code
Labels:
SwingHelloWorld
JFC Swing
FC is short for Java Foundation Classes, which encompass a group of features for building graphical user interfaces (GUIs) and adding rich graphics functionality and interactivity to Java applications.
"Swing" was the code name of the project that developed the new components. Although unofficial, it's frequently used to refer to the new components and related API. "Swing" is immortalized in the package names for the Swing API, which begin with javax.swing.
Labels:
JFC Swing Introduction
Subscribe to:
Posts (Atom)