» Home » jLabel » Page 1
only mouse clicked event of jlabel update jlabel text property properly
by Thomas in Programming Languages

i am using a java thread to update jlabel text value in my application
but after it updated text on jlabel
jlabel showing all past updated values and new value periodically in order via refreshing itself

but when i use same update function within the mouseclick event of jlabel it is updating itself as i expected and showing last value only

what can cause this p

how to put a JLabel inside a JLabel or divide a JLable into squares
by kaktos in Programming Languages

I have created a snake and ladder game and it works well, but now I want to add a little bit modification to it. I want each player to have two pieces/players instead of one. The new rule now becomes, two pieces of the same player can occupy the same square, hence I need a way to show them in the same square.
I used JLable to identify each square, but now I want each square to hold more th

Creating border around ImageIcon on a JLabel, not around the Jlabel
by Paul McKee in Programming Languages

I have problem with creating border for an icon in JLabel. I have JPanel in which I set it into GridLayout. I added Jlabel on the JPanel. The size of the JLabel were according to the size of the icon. However when I tried to set the border on the icon, it created border according to the size of the grid and not the size of the icon inside the grid.

How can I create a b

how to copy properties of a jlabel to another new jlabel
by squarecut1 in Programming Languages

I want to copy my private jlabel object to a new jlabel object and make the new one public. Idea is to allow anyone to access jlabel's properties but not to allow make any changes that will be displayed on the original interface. Below code doesnt work as it simply copies the reference of the original object.

public javax.swing.JLabel getCopyOfLabel(int labelno) {

Place JLabel on top of JLabel with image in
by KCro in Programming Languages

I am pretty sure that this question has been asked before, but my case is slightly different as in i am trying to place a JLabel on top of a JLabel acting as a background, I want to display changing numbers using the JLabels and the numbers need to display over the background, however i am a bit of a swing n00b, thanks in advance, Jonathan

Java. Drag & Drop ImageIcon from JLabel on panel 1, to JLabel on panel 2. Add Counter function
by keyed in Development Tools & Services

I've implemented this very basic, drag and drop between two JPanels, but this doesn't really meet my requirements!

public class test extends JFrame {
{ JPanel mainpanel, storypanel, imageselect;
public test(){
mainpanel = new JPanel(new BorderLayout());
storypanel = new JPanel();
imageselect = new JPanel();

Displaying a JLabel on top of another JLabel
by Mike Bakalov in Programming Languages

I have the following code:

try {
File file_background = new File(
ImageIcon icon_background = new ImageIcon(
JLabel background = new JLabel(icon_background);
File file_car

JLabel withing another JLabel
by Fezlakk in Programming Languages

I want to do a very simple thing with java swing and I'm not being able to.

I added a jLabel as it is the only object using java swing that can hold an image (using the icon property)...at least I wasn't able to set an image using other objects.

Now I want to add another jlabel in top of the first one with another image so it can be "clicked" independently from the "bac

Making a JLabel become another JLabel
by apaunchev in Development Tools & Services

So, here is my problem. I have a JPanel, with a JLabel on it, and what I want is once that JLabel is clicked, it should resize, (ideally it will change with it's scale, but for now I am using a constant value). I have returned the image, and I now that I am able to scale it, but I just cant manage to make the original JLabel become the newly sized one.

So this is what should happen

JLabel on top of another JLabel
by asp.net in Programming Languages

Is it possible to add a JLabel on top of another JLabel? Thanks.

Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .