Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 242
  • Last Modified:

Menu

Hello there,

I need an advice on the design of my program for school,
when the user open the window, a JTabbedPane appear.

If the user click on one of those tabs, he can see a JTable
and I would like to add a menu that let him do several things with the data in the Jtable
for example, add a row, edit a line, etc.

I tried to add buttons in a JPanel on the right of the JTable (so by default with a FlowLayout) , but the problem is that the buttons don't have all the same size, so I tried with a BorderLayout but then they getting bigger ...

maybe buttons wasn't a good idea,
(I would like to see directly all the options available,
so for example a JComboBox won't do it)

Has anyone an advice for me ?
Thank you.
0
matthew016
Asked:
matthew016
  • 2
2 Solutions
 
matthew016Author Commented:
I tried a JToolBar on the left, it's looks good but i can't let the buttons have the same size and make a vetical alignment
0
 
NaeemgCommented:
use buttons with GridBagLayout
0
 
mkandreCommented:
GridLayout (simpler) or GridBagLayout allows you control the layout much more than that of flow and border layouts.

optionally you can use a JMenuBar and just use setVisible(boolean) to make the diferent menus appear or disappear according to the selected tab.

mkaandre
0
 
matthew016Author Commented:
Hi there, I finally used a JToolBar with a GridLayout, looks good
Thanks u both
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now