Hello,
I'm trying to set up a panel with a group layout, and I wanted to know if I could code my groups like this:
GroupLayout menuLayout = new GroupLayout(men u);
menu.setLayout( menuLayout);
menuLayout.setH orizontalGroup(
menuLayout.crea teParallelGroup (GroupLayout.Al ignment.LEADING )
mainDishes = new JLabel();
mainDishes.setF ont(new Font("SansSerif ", 1, 14));
mainDishes.setF oreground(new Color(0,0,0));
mainDishes.setH orizontalAlignm ent(SwingConsta nts.CENTER);
mainDishes.setT ext("Main Dishes");
menuPanel.add(m ainDishes);
.addComponent(m ainDishes, GroupLayout.Ali gnment.TRAILING , GroupLayout.DEF AULT_SIZE, 324, Short.MAX_VALUE )
Where I'm setting my group and then adding the components of my panel to each group respectivly, or something to that effect. I designed this in NetBeans, and I'm copying the code into TextPad because there are several things I don't understand about NetBeans and I don't have time to figure them all out before my assignment is due. Anyway, I'm looking for the most efficient way to code this, any suggestions would be appreciated.
I'm trying to set up a panel with a group layout, and I wanted to know if I could code my groups like this:
GroupLayout menuLayout = new GroupLayout(men u);
menu.setLayout( menuLayout);
menuLayout.setH orizontalGroup(
menuLayout.crea teParallelGroup (GroupLayout.Al ignment.LEADING )
mainDishes = new JLabel();
mainDishes.setF ont(new Font("SansSerif ", 1, 14));
mainDishes.setF oreground(new Color(0,0,0));
mainDishes.setH orizontalAlignm ent(SwingConsta nts.CENTER);
mainDishes.setT ext("Main Dishes");
menuPanel.add(m ainDishes);
.addComponent(m ainDishes, GroupLayout.Ali gnment.TRAILING , GroupLayout.DEF AULT_SIZE, 324, Short.MAX_VALUE )
Where I'm setting my group and then adding the components of my panel to each group respectivly, or something to that effect. I designed this in NetBeans, and I'm copying the code into TextPad because there are several things I don't understand about NetBeans and I don't have time to figure them all out before my assignment is due. Anyway, I'm looking for the most efficient way to code this, any suggestions would be appreciated.