~ubuntu-branches/ubuntu/trusty/libjgoodies-forms-java/trusty

« back to all changes in this revision

Viewing changes to src/tutorial/com/jgoodies/forms/tutorial/building/ButtonStacksExample.java

  • Committer: Bazaar Package Importer
  • Author(s): Varun Hiremath
  • Date: 2010-02-11 16:00:46 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100211160046-e96n4h9fqbffl79b
Tags: 1.3.0-1
* New upstream release
* Bump Standards-Version to 3.8.4
* (Build)-Depends on default-jdk-doc (Closes: #567281)
* Switch to source format 3.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (c) 2002-2008 JGoodies Karsten Lentzsch. All Rights Reserved.
 
2
 * Copyright (c) 2002-2009 JGoodies Karsten Lentzsch. All Rights Reserved.
3
3
 *
4
4
 * Redistribution and use in source and binary forms, with or without
5
5
 * modification, are permitted provided that the following conditions are met:
39
39
import com.jgoodies.forms.factories.Borders;
40
40
import com.jgoodies.forms.layout.CellConstraints;
41
41
import com.jgoodies.forms.layout.FormLayout;
 
42
import com.jgoodies.forms.tutorial.util.TutorialApplication;
42
43
 
43
44
/**
44
45
 * Demonstrates how to build button stacks using the ButtonStackBuilder.
45
46
 *
46
47
 * @author  Karsten Lentzsch
47
 
 * @version $Revision: 1.19 $
 
48
 * @version $Revision: 1.23 $
48
49
 *
49
50
 * @see     ButtonStackBuilder
50
51
 */
51
 
public final class ButtonStacksExample {
 
52
public final class ButtonStacksExample extends TutorialApplication {
 
53
 
 
54
 
 
55
    // Launching **************************************************************
52
56
 
53
57
    public static void main(String[] args) {
54
 
        try {
55
 
            UIManager.setLookAndFeel("com.jgoodies.looks.plastic.PlasticXPLookAndFeel");
56
 
        } catch (Exception e) {
57
 
            // Likely PlasticXP is not in the class path; ignore.
58
 
        }
59
 
        JFrame frame = new JFrame();
60
 
        frame.setTitle("Forms Tutorial :: Button Stacks");
61
 
        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
62
 
        JComponent panel = new ButtonStacksExample().buildPanel();
63
 
        frame.getContentPane().add(panel);
64
 
        frame.pack();
65
 
        frame.setVisible(true);
66
 
    }
67
 
 
 
58
        TutorialApplication.launch(ButtonStacksExample.class, args);
 
59
    }
 
60
 
 
61
 
 
62
    protected void startup(String[] args) {
 
63
        JFrame frame = createFrame("Forms Tutorial :: Button Stacks");
 
64
        frame.getContentPane().add(buildPanel());
 
65
        packAndShowOnScreenCenter(frame);
 
66
    }
 
67
 
 
68
 
 
69
    // Building ***************************************************************
68
70
 
69
71
    public JComponent buildPanel() {
70
72
        JTabbedPane tabbedPane = new JTabbedPane();