473,498 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

icon on JFrame and then GridLayout

82 New Member
I want to ask something about swing.
Can i set an icon ( it is a big picture) in JFrame and then add labels with GridLayout over the picture?What i want to do is :
in my window i want to have a big picture
and then i want to put with GridLayout other labels or buttons , i mean i will put these in specific positions in the image.I don't want to delete the image.Is this possible?
One of those things that i want to add on the picture it would me some little circles,how will i do this? I thing to put a gif ( which has a circle ) in a label, is this good technic ? or not?

and something else : in the sun java tutorial where says how can i set a picture, because i can't find it?


Thanks
Mar 20 '08 #1
2 1858
Laharl
849 Recognized Expert Contributor
You can't put images in JLabels, those are for text. To add an icon to a JFrame, look at the Image class. I don't know how to add the additional images, but I'd guess it involves Panes.
Mar 20 '08 #2
JosAH
11,448 Recognized Expert MVP
You can't put images in JLabels, those are for text. To add an icon to a JFrame, look at the Image class. I don't know how to add the additional images, but I'd guess it involves Panes.
You can put an icon (e.g. an ImageIcon) in a JLabel; read its API. About that
picture and other things: be creative with a LayeredLayout and transparent (i.e.
not opaque) JPanels and possibly other layout managers.

kind regards,

Jos
Mar 21 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
3309
by: Tuno | last post by:
I'm relatively new to Java Swing programming. I have a console application that processes text files and while doing so I want to suspend the execution when an error is encountered that requires...
1
1611
by: ivannavi | last post by:
I need to open my JFrame from icon in taskbar (like date and time properties window). Which class offers this option. And in this icon i need to display String too. Just like time is showed ....
5
6838
Shinzon
by: Shinzon | last post by:
ok so far I have got: JFrame frame = new JFrame( "Matt's DVD's" ); frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ); frame.setSize( 420, 170 ); // set frame size ...
5
6895
Shinzon
by: Shinzon | last post by:
Ok so I have been working on this for a moment now and wondering how to add multiple jlabels to a jframe. the code looks like this: JLabel jl = new JLabel("DVD ID #= " + dvd); //Displays DVD...
1
2659
by: Didje | last post by:
Hi, I am trying to create a grid which contains three rows, within each row there will be various buttons also in gridlayout. There are 20 buttons in the middle row, 3 in the top and 4 at the...
5
4127
by: wajedali | last post by:
Hi I am having trouble rendering a combo box with icon near the text. Below is a simple code which demonstrates my problem. import java.awt.Component; import java.util.HashMap; import...
7
7984
by: kalar | last post by:
i make a JFrame window and i add a label i.e. myLabel , which has an image and down from the label a button i.e. dice. I want when i press the button to change the image on the label but when i am...
6
13822
by: gaya3 | last post by:
Hi, I need to make the frame invisible on action event in swings. I have the following code: public class sample_pgm extends JFrame{ public void sample() { JFrame jf =...
1
6117
by: sibusiso | last post by:
HI Can anyone help with the scenario where where you have to pass a certain data from one JFrame to another. For example, suppose you have a JFrame is your main window you disabled your Jmenu...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7165
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7205
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6887
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7379
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4910
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4590
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1419
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.