Hi everyone I have a problem. If anyone can help it would be great. I am using border and gridlayout and I am
This is an example of what I mentioned in the comment (with a few other tweaks).
package test;
import java.awt.*;
import javax.swing.*;
public class PanelFurniture extends JPanel
{
private static final long serialVersionUID = 4231608548183463223L;
JButton center, east;
// leading/trailing spaces in these labels will be ignored.
JButton[] commandButtons = {
new JButton("Add Chair"),
new JButton("Add Table"),
new JButton("Add Desk "),
new JButton("Clear All "),
new JButton("Total Price"),
new JButton("Summary "),
new JButton("Save"),
new JButton("Load")
};
JPanel centerPanel, eastPanel;
PanelFurniture()
{
this.setLayout(new BorderLayout());
JToolBar toolBar = new JToolBar();
for(int i=0; i
This GUI is based on the image.
package test;
import java.awt.BorderLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.border.EmptyBorder;
public class PanelFurniture extends JPanel
{
private static final long serialVersionUID = 4231608548183463223L;
JButton center, east;
// leading/trailing spaces in these labels will be ignored.
JButton[] commandButtons = {
new JButton("Add Chair"),
new JButton("Add Table"),
new JButton("Add Desk "),
new JButton("Clear All "),
new JButton("Total Price"),
new JButton("Summary "),
new JButton("Save"),
new JButton("Load")
};
JPanel centerPanel, westPanel, westPanelConstrain, eastPanel;
PanelFurniture()
{
super(new BorderLayout(2,2));
this.setBorder(new EmptyBorder(4,4,4,4));
westPanel = new JPanel(new GridLayout(0,1,4,4));
for(int i=0; i