VonC
2008-11-04 07:05:30
I have not seen a java component called JStatusBar. Was that added after Java 1.4?
Shree
2008-11-04 10:30:24
A:
ummm putting an image there is not hard... the resizing is. you'll want to use (once you have some sort of button) code like this:
private void buttonMousePressed(java.awt.event.MouseEvent evt) {
sx = evt.getX();
sy = evt.getY();
}
private void buttonMouseDragged(java.awt.event.MouseEvent evt) {
if(!evt.isMetaDown()){
Point p = getLocation();
locX = p.x + evt.getX()-sx;
locY = p.y + evt.getY()-sy;
setLocation(locX, locY);
}
}
...except instead of Setlocation you'll want to use something like setBounds or setSize... and you'll have to modify the code a bit. What I have is for dragging it, but the principle is the same.
I have implemented the functionality using the approach given in the 'accepted answer'. I wanted to know whether if there was already a resizable java component so that I am not reinventing the wheel.:)
Shree
2009-04-15 09:21:47