Archive for September 17th, 2006
Java Swing: resize Undecorated window
Hi, here is code snap to make resizable your undecorated window
private void _setUpWindowResizeEvent() {
this.addMouseMotionListener(
new MouseMotionListener() {
public void mouseDragged(MouseEvent mouseEvent) {
if( mHozResizeEnabled || mVerResizeEnabled ) {
int x = mouseEvent.getX();
int y = mouseEvent.getY();
_resizeWindow( MouseInfo.getPointerInfo().getLocation() );
}
}
public void mouseMoved(MouseEvent mouseEvent) {
boolean horizontalResize = mouseEvent.getX() = getWidth()-5;
boolean verticalResize = mouseEvent.getY() = getHeight()-5;
if( horizontalResize ) {
setCursor( new Cursor( Cursor.W_RESIZE_CURSOR ) );
mHozResizeEnabled = true;
mWindowMouseClickPoint = mouseEvent.getPoint();
}
else if( verticalResize ) {
setCursor( new Cursor( Cursor.S_RESIZE_CURSOR ) );
mVerResizeEnabled = true;
mWindowMouseClickPoint = mouseEvent.getPoint();
}
else {
setCursor( new Cursor( Cursor.DEFAULT_CURSOR ) );
mHozResizeEnabled = false;
mVerResizeEnabled = false;
}
}
}
);
}
Great Song from “Yatri” “Akta gopon kota….”
I am not much music fan… few days back I stacked with a music of “Yatri” “Akta gopon kota ….” Bangladeshi musician…. I really wondered How great a music could be….
I continued this music for more than 40 times still repeating…. Great one….
Thanks Omi Azad whom I called and heard such great music…. And also thanks Yatri….
Album: shopnochura
Résumé in Web 2.0 way ….
I have made a presentation to demonstrate, how people can use web 2.0 concepts on a silly stuff like personal Résumé….
Download “Résumé in web 2.0 way” Presentation…
I will be pleased if people get it interesting… best wishes…
drag java undecorated window
Just for reminder,
“How to drag undecorated window”
place a JLabel or what ever component which does support mouse mototion and mouse event listener.
undecorated window: when window is head less. no caption bar no resizable border. is enabled by setUndecorated( true );
private boolean mMoveStart = false;
private Point mMouseClickPoint = null;
private void _setUpMoveEvent() {
mWindowTitleLabel.addMouseMotionListener(
new MouseMotionListener() {
public void mouseDragged(MouseEvent mouseEvent) {
if (mMoveStart)
_moveWindowTo(mouseEvent.getPoint());
}
public void mouseMoved(MouseEvent mouseEvent) {
}
}
);
mWindowTitleLabel.addMouseListener(
new MouseAdapter() {
public void mousePressed(MouseEvent mouseEvent) {
mMouseClickPoint = mouseEvent.getPoint();
mMoveStart = true;
}
public void mouseReleased(MouseEvent mouseEvent) {
mMoveStart = false;
_fireStickyUpdated();
}
}
);
}
private void _moveWindowTo(Point point) {
int musDiffX = point.x - mMouseClickPoint.x;
int musDiffY = point.y - mMouseClickPoint.y;
setLocation( getLocation().x + musDiffX, getLocation().y + musDiffY );
sticky.setLocation( getLocation() );
}
here, mWindowTitleLable is JLable component
For old Fan!!!
hi, i am getting some request for my previous “ajax-new-color” theme.
i have changed my file system thats why previous files are lost.
please find out this attachment…. ajax-new-color
thank u




