I tried to Find API that restrict component's movable area only in inside of Frame. Is there such API?
I guess such function is located in category of JFrame. but actually there are almost things about making components of Swing. I also searched API of SwingUtilities, but i think there are no useful API related to my problem.
public void mouseDragged(MouseEvent arg0) {
// TODO Auto-generated method stub
Point MousePoint=arg0.getPoint();
label.setBounds(0, 0, c.getWidth(), c.getHeight());
label.setLocation(MousePoint);
}
public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub
label.setBounds(0, 0, c.getWidth(), c.getHeight());
label.setLocation(getLocationOnScreen());
}
I expected using setBounds() will restrict movable area in Frame. but when i drag label over area of Frame, it was find that label move along.