Form Designer Issue
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Saad_Faisal
Posted On:   Saturday, May 19, 2001 01:05 AM

I was trying to develop a simple form designer with AWT beccause of two reasons 1. I am almost tired visualizing things with LayoutManagers 2. I don't want to use any IDE such as Cafe or JBuilder. For a testbed i set up a null layout on my frame and then i created a button on my form. Next i added a MouseMotionListener on my button which does something like this Button mybtn=new Button("Dragg Me"); mybtn.addMouseMotionListener(new MouseMotionListener() { public void mouseDragged(MouseEvent e) { Dimension d=mybtn.getPreferedSize(); mybtn.setBounds(e.getX(),e.getY(),d.width,d.height); } } The only problem is that my butt   More>>

I was trying to develop a simple form designer with AWT beccause of two reasons

1. I am almost tired visualizing things with LayoutManagers
2. I don't want to use any IDE such as Cafe or JBuilder.

For a testbed i set up a null layout on my frame and then i created a button on my form. Next i added a MouseMotionListener on my button which does something like this

Button mybtn=new Button("Dragg Me");

mybtn.addMouseMotionListener(new MouseMotionListener()
{
public void mouseDragged(MouseEvent e)
{
Dimension d=mybtn.getPreferedSize();

mybtn.setBounds(e.getX(),e.getY(),d.width,d.height);
}
}


The only problem is that my button at the previous flashes so much and doesn't even move to the right location. What am i missing here??

   <<Less
About | Sitemap | Contact