summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gilbert <david.gilbert@object-refinery.com>2005-10-29 05:04:21 +0000
committerDavid Gilbert <david.gilbert@object-refinery.com>2005-10-29 05:04:21 +0000
commit69b3701a692f50b2d551cb3b930d3ccbc44a53f0 (patch)
treea6f3a2ebb5711ca7415f625ceddd52debe24c8b3
parentc0d2f84ebc78a2d5926afadf032cfeeb85fc0d30 (diff)
downloadclasspath-69b3701a692f50b2d551cb3b930d3ccbc44a53f0.tar.gz
2005-10-29 David Gilbert <david.gilbert@object-refinery.com>
* examples/gnu/classpath/examples/swing/ButtonDemo.java (ButtonDemo): add closePanel after content is created, (createContent): don't add closePanel here, * examples/gnu/classpath/examples/swing/ComboBoxDemo.java (ButtonDemo): add closePanel after content is created, (createContent): don't add closePanel here, * examples/gnu/classpath/examples/swing/ScrollBarDemo.java (ButtonDemo): add closePanel after content is created, (createContent): don't add closePanel here, * examples/gnu/classpath/examples/swing/SliderDemo.java (ButtonDemo): add closePanel after content is created, (createContent): add separate checkBoxPanel but don't add closePanel here.
-rw-r--r--ChangeLog16
-rw-r--r--examples/gnu/classpath/examples/swing/ButtonDemo.java24
-rw-r--r--examples/gnu/classpath/examples/swing/ComboBoxDemo.java22
-rw-r--r--examples/gnu/classpath/examples/swing/ScrollBarDemo.java22
-rw-r--r--examples/gnu/classpath/examples/swing/SliderDemo.java30
5 files changed, 83 insertions, 31 deletions
diff --git a/ChangeLog b/ChangeLog
index 13eb9e79c..0afa08bbd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2005-10-29 David Gilbert <david.gilbert@object-refinery.com>
+
+ * examples/gnu/classpath/examples/swing/ButtonDemo.java
+ (ButtonDemo): add closePanel after content is created,
+ (createContent): don't add closePanel here,
+ * examples/gnu/classpath/examples/swing/ComboBoxDemo.java
+ (ButtonDemo): add closePanel after content is created,
+ (createContent): don't add closePanel here,
+ * examples/gnu/classpath/examples/swing/ScrollBarDemo.java
+ (ButtonDemo): add closePanel after content is created,
+ (createContent): don't add closePanel here,
+ * examples/gnu/classpath/examples/swing/SliderDemo.java
+ (ButtonDemo): add closePanel after content is created,
+ (createContent): add separate checkBoxPanel but don't add closePanel
+ here.
+
2005-10-28 Roman Kennke <kennke@aicas.com>
* java/awt/KeyboardFocusManager.java
diff --git a/examples/gnu/classpath/examples/swing/ButtonDemo.java b/examples/gnu/classpath/examples/swing/ButtonDemo.java
index 1dc95ee67..b53ba3b5c 100644
--- a/examples/gnu/classpath/examples/swing/ButtonDemo.java
+++ b/examples/gnu/classpath/examples/swing/ButtonDemo.java
@@ -76,9 +76,23 @@ public class ButtonDemo
public ButtonDemo(String title)
{
super(title);
- getContentPane().add(createContent());
+ JPanel content = createContent();
+ JPanel closePanel = new JPanel();
+ JButton closeButton = new JButton("Close");
+ closeButton.setActionCommand("CLOSE");
+ closeButton.addActionListener(this);
+ closePanel.add(closeButton);
+ content.add(closePanel, BorderLayout.SOUTH);
+ getContentPane().add(content);
}
-
+
+ /**
+ * Returns a panel with the demo content. The panel
+ * uses a BorderLayout(), and the BorderLayout.SOUTH area
+ * is empty, to allow callers to add controls to the
+ * bottom of the panel if they want to (a close button is
+ * added if this demo is being run as a standalone demo).
+ */
JPanel createContent()
{
JPanel content = new JPanel(new BorderLayout());
@@ -88,12 +102,6 @@ public class ButtonDemo
panel.add(createCheckBoxPanel());
panel.add(createRadioPanel());
content.add(panel);
- JPanel closePanel = new JPanel();
- JButton closeButton = new JButton("Close");
- closeButton.setActionCommand("CLOSE");
- closeButton.addActionListener(this);
- closePanel.add(closeButton);
- content.add(closePanel, BorderLayout.SOUTH);
return content;
}
diff --git a/examples/gnu/classpath/examples/swing/ComboBoxDemo.java b/examples/gnu/classpath/examples/swing/ComboBoxDemo.java
index 0e236816e..52431cb5d 100644
--- a/examples/gnu/classpath/examples/swing/ComboBoxDemo.java
+++ b/examples/gnu/classpath/examples/swing/ComboBoxDemo.java
@@ -101,9 +101,23 @@ public class ComboBoxDemo
public ComboBoxDemo(String title)
{
super(title);
- getContentPane().add(createContent());
+ JPanel content = createContent();
+ JPanel closePanel = new JPanel();
+ JButton closeButton = new JButton("Close");
+ closeButton.setActionCommand("CLOSE");
+ closeButton.addActionListener(this);
+ closePanel.add(closeButton);
+ content.add(closePanel, BorderLayout.SOUTH);
+ getContentPane().add(content);
}
+ /**
+ * Returns a panel with the demo content. The panel
+ * uses a BorderLayout(), and the BorderLayout.SOUTH area
+ * is empty, to allow callers to add controls to the
+ * bottom of the panel if they want to (a close button is
+ * added if this demo is being run as a standalone demo).
+ */
JPanel createContent()
{
JPanel content = new JPanel(new BorderLayout());
@@ -115,12 +129,6 @@ public class ComboBoxDemo
panel.add(createPanel5());
panel.add(createPanel6());
content.add(panel);
- JPanel closePanel = new JPanel();
- JButton closeButton = new JButton("Close");
- closeButton.setActionCommand("CLOSE");
- closeButton.addActionListener(this);
- closePanel.add(closeButton);
- content.add(closePanel, BorderLayout.SOUTH);
return content;
}
diff --git a/examples/gnu/classpath/examples/swing/ScrollBarDemo.java b/examples/gnu/classpath/examples/swing/ScrollBarDemo.java
index f1ee259c2..fce137301 100644
--- a/examples/gnu/classpath/examples/swing/ScrollBarDemo.java
+++ b/examples/gnu/classpath/examples/swing/ScrollBarDemo.java
@@ -48,20 +48,28 @@ public class ScrollBarDemo
public ScrollBarDemo(String title)
{
super(title);
- getContentPane().add(createContent());
+ JPanel content = createContent();
+ JPanel closePanel = new JPanel();
+ JButton closeButton = new JButton("Close");
+ closeButton.setActionCommand("CLOSE");
+ closeButton.addActionListener(this);
+ closePanel.add(closeButton);
+ content.add(closePanel, BorderLayout.SOUTH);
+ getContentPane().add(content);
}
+ /**
+ * Returns a panel with the demo content. The panel
+ * uses a BorderLayout(), and the BorderLayout.SOUTH area
+ * is empty, to allow callers to add controls to the
+ * bottom of the panel if they want to (a close button is
+ * added if this demo is being run as a standalone demo).
+ */
JPanel createContent()
{
JPanel content = new JPanel(new BorderLayout());
JPanel panel = createScrollBarPanel();
content.add(panel);
- JPanel closePanel = new JPanel();
- JButton closeButton = new JButton("Close");
- closeButton.setActionCommand("CLOSE");
- closeButton.addActionListener(this);
- closePanel.add(closeButton);
- content.add(closePanel, BorderLayout.SOUTH);
return content;
}
diff --git a/examples/gnu/classpath/examples/swing/SliderDemo.java b/examples/gnu/classpath/examples/swing/SliderDemo.java
index 3575a4c32..736024c48 100644
--- a/examples/gnu/classpath/examples/swing/SliderDemo.java
+++ b/examples/gnu/classpath/examples/swing/SliderDemo.java
@@ -59,27 +59,39 @@ public class SliderDemo extends JFrame implements ActionListener
public SliderDemo(String frameTitle)
{
super(frameTitle);
- getContentPane().add(createContent());
+ JPanel content = createContent();
+ JPanel closePanel = new JPanel();
+ JButton closeButton = new JButton("Close");
+ closeButton.setActionCommand("CLOSE");
+ closeButton.addActionListener(this);
+ closePanel.add(closeButton);
+ content.add(closePanel, BorderLayout.SOUTH);
+ getContentPane().add(content);
}
+ /**
+ * Returns a panel with the demo content. The panel
+ * uses a BorderLayout(), and the BorderLayout.SOUTH area
+ * is empty, to allow callers to add controls to the
+ * bottom of the panel if they want to (a close button is
+ * added if this demo is being run as a standalone demo).
+ */
JPanel createContent()
{
JPanel content = new JPanel(new BorderLayout());
JPanel panel = new JPanel(new GridLayout(1, 2));
panel.add(createHorizontalPanel());
panel.add(createVerticalPanel());
- content.add(panel);
- JPanel closePanel = new JPanel();
enabledCheckBox = new JCheckBox("Enabled");
enabledCheckBox.setSelected(true);
enabledCheckBox.setActionCommand("TOGGLE_ENABLED");
enabledCheckBox.addActionListener(this);
- closePanel.add(enabledCheckBox);
- JButton closeButton = new JButton("Close");
- closeButton.setActionCommand("CLOSE");
- closeButton.addActionListener(this);
- closePanel.add(closeButton);
- content.add(closePanel, BorderLayout.SOUTH);
+ JPanel checkBoxPanel = new JPanel();
+ checkBoxPanel.add(enabledCheckBox);
+ JPanel panel2 = new JPanel(new BorderLayout());
+ panel2.add(panel);
+ panel2.add(checkBoxPanel, BorderLayout.SOUTH);
+ content.add(panel2);
return content;
}