What I want to accomplish is simple, I press a JButton (called 'right') and the x bounds of a JLabel is increased by 100, effectively moving the JLabel 100 pixels to the right. I have been experimenting with stuff such as :
if(clicked == right) {
piece.getBounds().x = +100;
}
and I tried :
if(clicked == right) {
piece.addBounds(100,0,0,0);
}
the method addBounds was undefined for type JLabel so I tried :
if(clicked == right) {
piece.setBounds(+100,0,0,0);
}
and clearly all of the above didn't work, but were worth the try. Is there a way to do what I'm tried to do?