Java-GNOME 2.10 GNOME Tutorial
<<< Previous | Containers | Next >>>

# ButtonBox

The ButtonBox container is designed to contain a group of buttons. An example from TestGTK is below.

Example 7. TestGTK.java - ButtonBox

    	private Frame createButtonBox(boolean horizontal, String title, int spacing,
    		int childWidth, int childHeight, ButtonBoxStyle layout) {
    		ButtonBox box;

    		Frame frame = new Frame(title);
    		if (horizontal) {
    			box = new HButtonBox();
    		} else {
    			box = new VButtonBox();
    		}

    		box.setBorderWidth(5);
    		frame.add(box);

    		box.setLayout(layout);
    		box.setSpacing(spacing);

    		Button button;
    		button = new Button("OK", false);
    		box.add(button);
    		button = new Button("Cancel", false);
    		box.add(button);
    		button = new Button("Help", false);
    		box.add(button);

    		return frame;
    	}

<<< Previous | Home | Next >>>
Notebook | Up | Non-Visual Classes