views:

875

answers:

3
+1  A: 
VonC
A: 

the JStatusBar ?

Frederic Morin
I have not seen a java component called JStatusBar. Was that added after Java 1.4?
Shree
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