-
Enhancement
-
Resolution: Duplicate
-
P4
-
None
-
1.4.2
-
x86
-
windows_xp
Name: rmT116609 Date: 09/08/2004
A DESCRIPTION OF THE REQUEST :
It woulb be great if Swing can offer some kinds of toolbar containers which enable these features:
1. Toolbar container can be contain several toolbars
2. The toolbars can be smoothly moved in the toolbar container
3. The container support automatic wrapping-in feature as the Windows forms in .Net
JUSTIFICATION :
Implementing this feature will help better application with great GUI.
ACTUAL -
There can be only one toolbar in the application, the toolbar can not be divided into several pieces
---------- BEGIN SOURCE ----------
import java.awt.BorderLayout;
import java.awt.Container;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JToolBar;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
public class ToolbarHandling {
static {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
e.printStackTrace();
}
}
public ToolbarHandling() {
final JFrame frame = new JFrame("Test (Simple toolbar)");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JToolBar toolbar1 = new JToolBar();
toolbar1.add(new JButton("-- toolbar one ---"));
JToolBar toolbar2 = new JToolBar();
toolbar2.add(new JButton("-- toolbar two ---"));
Container contentPane = frame.getContentPane();
contentPane.add(toolbar1, BorderLayout.NORTH);
contentPane.add(toolbar2, BorderLayout.EAST);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
frame.pack();
frame.setSize(600, 200);
frame.show();
}
});
}
public static void main(String[] args) {
new ToolbarHandling();
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Write your own component
(Incident Review ID: 302285)
======================================================================
- duplicates
-
JDK-4161616 Make tool bars more like MS toolbars
-
- Open
-