hasan's blog (বল্গ)

work for fun!!!

Archive for September 17th, 2006

Java Swing: resize Undecorated window

with 2 comments

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;
}

}
}
);
}

Written by nhm tanveer hossain khan

September 17, 2006 at 8:44 pm

Posted in Java, Java SE, java swing

Great Song from “Yatri” “Akta gopon kota….”

leave a comment »

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

Written by nhm tanveer hossain khan

September 17, 2006 at 7:01 pm

Posted in life

Résumé in Web 2.0 way ….

with 2 comments

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…

Written by nhm tanveer hossain khan

September 17, 2006 at 6:29 pm

Posted in Ideas

drag java undecorated window

leave a comment »

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

:D

Written by nhm tanveer hossain khan

September 17, 2006 at 5:00 pm

Posted in Java, Java SE, java swing

For old Fan!!!

leave a comment »

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 :D

Written by nhm tanveer hossain khan

September 17, 2006 at 4:48 pm

Posted in PHP