Reputation: 1
I have a paint-like project, in which I recently added a JSpinner, but after researching how to add it to the JFrame, it ends up looking like this:
but I would like it to look like this:
how would I accomplish this? Thanks in advance.
P.D: The code used to create the current project is this:
public View( final String title ){
super( title );
}
public void init()
{
canvas = new Canvas();
menuManager = new MenuManager();
toolBarManager = new ToolBarManager( JToolBar.VERTICAL );
spinnerManager = new SpinnerManager();
JPanel subPanel = new JPanel( new FlowLayout() );
subPanel.add( menuManager );
subPanel.add( spinnerManager );
add( BorderLayout.CENTER, canvas );
add( BorderLayout.NORTH, menuManager);
add( BorderLayout.EAST, toolBarManager );
setDefaultCloseOperation( EXIT_ON_CLOSE );
App.getInstance().addDrawingListener( this );
canvas.init();
}
Upvotes: 0
Views: 481
Reputation: 285403
Simply give the top JPanel an appropriate FlowLayout: new FlowLayout(FlowLayout.LEADING))
Upvotes: 1