floatAPI
welcome to the floatAPI project which developes the floatingAPI, a Java
1.4. Swing lib to provide easy to implement floating Components.
what it does:
floatAPI is a Open Source Project licensed
under LGPL hosted on SourceForge.net:
a useable release can be downloaded:
example implementation:
//get the default FloatingHandler
final FloatingHandler handler = FloatingHandler.getDefaultHandler();
//set a desired Cursor for dragging gestures
handler.setGestureCursor(new Cursor(Cursor.HAND_CURSOR));
//build a standard JFrame
JFrame frame=new JFrame("main window");
frame.setBounds(100,100,200,200);
frame.getContentPane().setLayout(new
BorderLayout());
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//add a possibility to dock in
JDocker docker=new JDocker(false);
frame.getContentPane().add(docker,BorderLayout.CENTER);
//create a panel with a button inside
final JFloater panel=new JFloater();
JButton b=new JButton("inside floating");
panel.add(b);
//add an indirect trigger on the button for an actual drag-start on panel
b.addMouseListener(new MouseAdapter(){
public void mousePressed(MouseEvent e) {
handler.startDrag(panel, e);
}
});
//register docker and panel to make them
work
handler.add(docker);
handler.add(panel);
//start with the panel being docked in the
docker
handler.dock(panel,docker);
//make standard JFrame visible
frame.setVisible(true);
other information:
developer links
Open Source Code under LGPL License
© copyright by floatAPI project group