summaryrefslogtreecommitdiff
path: root/examples/gnu
diff options
context:
space:
mode:
Diffstat (limited to 'examples/gnu')
-rw-r--r--examples/gnu/classpath/examples/CORBA/NamingService/Demo.java4
-rw-r--r--examples/gnu/classpath/examples/CORBA/SimpleCommunication/Demo.java4
-rw-r--r--examples/gnu/classpath/examples/CORBA/SimpleCommunication/comServer.java4
-rw-r--r--examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/DirectTest.java4
-rw-r--r--examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/_comTesterImplBase.java4
-rw-r--r--examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/_comTesterStub.java4
-rw-r--r--examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/comServant.java4
-rw-r--r--examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/comTester.java4
-rw-r--r--examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/node.java4
-rw-r--r--examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/nodeHelper.java4
-rw-r--r--examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/nodeHolder.java4
-rw-r--r--examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/ourUserException.java4
-rw-r--r--examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/ourUserExceptionHelper.java4
-rw-r--r--examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/passThis.java4
-rw-r--r--examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/passThisHelper.java4
-rw-r--r--examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/returnThis.java4
-rw-r--r--examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/returnThisHelper.java4
-rw-r--r--examples/gnu/classpath/examples/awt/Demo.java6
-rw-r--r--examples/gnu/classpath/examples/html/Demo.java4
-rw-r--r--examples/gnu/classpath/examples/swing/Demo.java116
-rw-r--r--examples/gnu/classpath/examples/swing/GNULookAndFeel.java23
21 files changed, 173 insertions, 44 deletions
diff --git a/examples/gnu/classpath/examples/CORBA/NamingService/Demo.java b/examples/gnu/classpath/examples/CORBA/NamingService/Demo.java
index 1d6403535..b4a37720f 100644
--- a/examples/gnu/classpath/examples/CORBA/NamingService/Demo.java
+++ b/examples/gnu/classpath/examples/CORBA/NamingService/Demo.java
@@ -15,8 +15,8 @@ General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
diff --git a/examples/gnu/classpath/examples/CORBA/SimpleCommunication/Demo.java b/examples/gnu/classpath/examples/CORBA/SimpleCommunication/Demo.java
index 70cdb1d27..85f233a1d 100644
--- a/examples/gnu/classpath/examples/CORBA/SimpleCommunication/Demo.java
+++ b/examples/gnu/classpath/examples/CORBA/SimpleCommunication/Demo.java
@@ -15,8 +15,8 @@ General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
diff --git a/examples/gnu/classpath/examples/CORBA/SimpleCommunication/comServer.java b/examples/gnu/classpath/examples/CORBA/SimpleCommunication/comServer.java
index 262fbcd99..d4e0c56b2 100644
--- a/examples/gnu/classpath/examples/CORBA/SimpleCommunication/comServer.java
+++ b/examples/gnu/classpath/examples/CORBA/SimpleCommunication/comServer.java
@@ -15,8 +15,8 @@ General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
diff --git a/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/DirectTest.java b/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/DirectTest.java
index cf3c41d07..5cf372b26 100644
--- a/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/DirectTest.java
+++ b/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/DirectTest.java
@@ -15,8 +15,8 @@ General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
diff --git a/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/_comTesterImplBase.java b/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/_comTesterImplBase.java
index 2c5c8683c..4c8f5b94c 100644
--- a/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/_comTesterImplBase.java
+++ b/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/_comTesterImplBase.java
@@ -15,8 +15,8 @@ General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
diff --git a/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/_comTesterStub.java b/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/_comTesterStub.java
index 437e81f08..b71cd8e86 100644
--- a/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/_comTesterStub.java
+++ b/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/_comTesterStub.java
@@ -15,8 +15,8 @@ General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
diff --git a/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/comServant.java b/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/comServant.java
index 7f286cbbc..08d1759d8 100644
--- a/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/comServant.java
+++ b/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/comServant.java
@@ -15,8 +15,8 @@ General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
diff --git a/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/comTester.java b/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/comTester.java
index 49188b6e1..495807eb9 100644
--- a/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/comTester.java
+++ b/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/comTester.java
@@ -15,8 +15,8 @@ General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
diff --git a/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/node.java b/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/node.java
index 4040eb769..527d02d06 100644
--- a/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/node.java
+++ b/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/node.java
@@ -15,8 +15,8 @@ General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
diff --git a/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/nodeHelper.java b/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/nodeHelper.java
index 46fc0a791..8d4121cda 100644
--- a/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/nodeHelper.java
+++ b/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/nodeHelper.java
@@ -15,8 +15,8 @@ General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
diff --git a/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/nodeHolder.java b/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/nodeHolder.java
index 93d53912a..8e4913912 100644
--- a/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/nodeHolder.java
+++ b/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/nodeHolder.java
@@ -15,8 +15,8 @@ General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
diff --git a/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/ourUserException.java b/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/ourUserException.java
index aea4a8bd9..51ea5f2d6 100644
--- a/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/ourUserException.java
+++ b/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/ourUserException.java
@@ -15,8 +15,8 @@ General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
diff --git a/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/ourUserExceptionHelper.java b/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/ourUserExceptionHelper.java
index 415adff1f..8c499df64 100644
--- a/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/ourUserExceptionHelper.java
+++ b/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/ourUserExceptionHelper.java
@@ -15,8 +15,8 @@ General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
diff --git a/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/passThis.java b/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/passThis.java
index f9ba02dc2..2a680b91b 100644
--- a/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/passThis.java
+++ b/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/passThis.java
@@ -15,8 +15,8 @@ General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
diff --git a/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/passThisHelper.java b/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/passThisHelper.java
index 13242fd63..6b9f4ce01 100644
--- a/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/passThisHelper.java
+++ b/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/passThisHelper.java
@@ -15,8 +15,8 @@ General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
diff --git a/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/returnThis.java b/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/returnThis.java
index b13b983bb..b7c3923ce 100644
--- a/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/returnThis.java
+++ b/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/returnThis.java
@@ -15,8 +15,8 @@ General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
diff --git a/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/returnThisHelper.java b/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/returnThisHelper.java
index db6a11217..79838d75c 100644
--- a/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/returnThisHelper.java
+++ b/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/returnThisHelper.java
@@ -15,8 +15,8 @@ General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
diff --git a/examples/gnu/classpath/examples/awt/Demo.java b/examples/gnu/classpath/examples/awt/Demo.java
index 91b67de1c..dbb6600ed 100644
--- a/examples/gnu/classpath/examples/awt/Demo.java
+++ b/examples/gnu/classpath/examples/awt/Demo.java
@@ -15,8 +15,8 @@ General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA. */
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA. */
package gnu.classpath.examples.awt;
@@ -613,7 +613,7 @@ class Demo
static class TestWindow extends SubFrame
{
static int xs = 5, ys = 5;
- private final Frame parent;
+ final Frame parent;
public TestWindow(Frame f)
{
diff --git a/examples/gnu/classpath/examples/html/Demo.java b/examples/gnu/classpath/examples/html/Demo.java
index b6ddc3550..34dd73b32 100644
--- a/examples/gnu/classpath/examples/html/Demo.java
+++ b/examples/gnu/classpath/examples/html/Demo.java
@@ -15,8 +15,8 @@ General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
diff --git a/examples/gnu/classpath/examples/swing/Demo.java b/examples/gnu/classpath/examples/swing/Demo.java
index 9301dd635..eef300619 100644
--- a/examples/gnu/classpath/examples/swing/Demo.java
+++ b/examples/gnu/classpath/examples/swing/Demo.java
@@ -15,8 +15,8 @@ General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
*/
@@ -429,6 +429,109 @@ public class Demo
return jsp;
}
+ private static JPanel mkTreeWorld()
+ {
+ // non-leafs
+ DefaultMutableTreeNode root = new DefaultMutableTreeNode("Exotic Subsistence");
+ DefaultMutableTreeNode fruit = new DefaultMutableTreeNode("Interesting Fruit");
+ DefaultMutableTreeNode veg = new DefaultMutableTreeNode("Extraordinary Vegetables");
+ DefaultMutableTreeNode liq = new DefaultMutableTreeNode("Peculiar Liquids");
+
+ // leafs
+ DefaultMutableTreeNode f1 = new DefaultMutableTreeNode("Abiu");
+ DefaultMutableTreeNode f2 = new DefaultMutableTreeNode("Bamboo Shoots");
+ DefaultMutableTreeNode f3 = new DefaultMutableTreeNode("Breadfruit");
+ DefaultMutableTreeNode f4 = new DefaultMutableTreeNode("Canistel");
+ DefaultMutableTreeNode f5 = new DefaultMutableTreeNode("Duku");
+ DefaultMutableTreeNode f6 = new DefaultMutableTreeNode("Guava");
+ DefaultMutableTreeNode f7 = new DefaultMutableTreeNode("Jakfruit");
+ DefaultMutableTreeNode f8 = new DefaultMutableTreeNode("Quaribea");
+
+ DefaultMutableTreeNode v1 = new DefaultMutableTreeNode("Amaranth");
+ DefaultMutableTreeNode v2 = new DefaultMutableTreeNode("Kiwano");
+ DefaultMutableTreeNode v3 = new DefaultMutableTreeNode("Leeks");
+ DefaultMutableTreeNode v4 = new DefaultMutableTreeNode("Luffa");
+ DefaultMutableTreeNode v5 = new DefaultMutableTreeNode("Chayote");
+ DefaultMutableTreeNode v6 = new DefaultMutableTreeNode("Jicama");
+ DefaultMutableTreeNode v7 = new DefaultMutableTreeNode("Okra");
+
+ DefaultMutableTreeNode l1 = new DefaultMutableTreeNode("Alcoholic");
+ DefaultMutableTreeNode l11 = new DefaultMutableTreeNode("Caipirinha");
+ DefaultMutableTreeNode l21 = new DefaultMutableTreeNode("Mojito");
+ DefaultMutableTreeNode l31 = new DefaultMutableTreeNode("Margarita");
+ DefaultMutableTreeNode l41 = new DefaultMutableTreeNode("Martini");
+ DefaultMutableTreeNode l5 = new DefaultMutableTreeNode("Non Alcoholic");
+ DefaultMutableTreeNode l55 = new DefaultMutableTreeNode("Babaji");
+ DefaultMutableTreeNode l65 = new DefaultMutableTreeNode("Chikita");
+
+ root.add(fruit);
+ root.add(veg);
+ root.add(liq);
+ fruit.add(f1);
+ fruit.add(f2);
+ fruit.add(f3);
+ fruit.add(f4);
+ fruit.add(f5);
+ fruit.add(f6);
+ fruit.add(f7);
+ fruit.add(f8);
+ veg.add(v1);
+ veg.add(v2);
+ veg.add(v3);
+ veg.add(v4);
+ veg.add(v5);
+ veg.add(v6);
+ veg.add(v7);
+ liq.add(l1);
+ l1.add(l11);
+ l1.add(l21);
+ l1.add(l31);
+ l1.add(l41);
+ liq.add(l5);
+ l5.add(l55);
+ l5.add(l65);
+
+ final JTree tree = new JTree(root);
+ tree.setLargeModel(true);
+ DefaultTreeSelectionModel dtsm = new DefaultTreeSelectionModel();
+ dtsm.setSelectionMode(DefaultTreeSelectionModel.SINGLE_TREE_SELECTION);
+ tree.setSelectionModel(dtsm);
+
+ // buttons to add and delete
+ JButton add = mkButton("add element");
+ add.addActionListener(new ActionListener()
+ {
+ int i = 0;
+ public void actionPerformed(ActionEvent e)
+ {
+ for (int i = 0; i < tree.getRowCount(); i++)
+ {
+ if (tree.isRowSelected(i))
+ {
+ TreePath p = tree.getPathForRow(i);
+ DefaultMutableTreeNode n = (DefaultMutableTreeNode) p.
+ getLastPathComponent();
+ n.add(new DefaultMutableTreeNode("New Element"));
+ tree.repaint();
+ break;
+ }
+ }
+ }
+ });
+
+
+ JPanel p1 = new JPanel();
+ p1.setLayout(new BorderLayout());
+
+ JPanel p2 = new JPanel();
+ p2.add(add);
+
+ p1.add(p2, BorderLayout.NORTH);
+ p1.add(mkScrollPane(tree), BorderLayout.CENTER);
+
+ return p1;
+ }
+
public static JPanel mkListWorld()
{
@@ -524,6 +627,7 @@ public class Demo
BorderLayout.CENTER);
desk.add(f);
f.setBounds(i, i, 250, 200);
+ f.setVisible(true);
i += 30;
}
});
@@ -544,6 +648,7 @@ public class Demo
tabs.add("Button world!", mkButtonWorld());
tabs.add("List world!", mkListWorld());
tabs.add("Desktop world!", mkDesktopWorld());
+ tabs.add("Tree world!", mkTreeWorld());
return tabs;
}
@@ -553,6 +658,8 @@ public class Demo
slider.setPaintTrack(true);
slider.setPaintTicks(true);
slider.setMajorTickSpacing(30);
+ slider.setMinorTickSpacing(5);
+ slider.setPaintLabels(true);
slider.setInverted(false);
JProgressBar progress = new JProgressBar();
BoundedRangeModel model = new DefaultBoundedRangeModel(10, 1, 0, 100);
@@ -837,6 +944,11 @@ public class Demo
child2.add(child24);
JTree tree = new JTree(root);
+ tree.setLargeModel(true);
+ DefaultTreeSelectionModel dtsm = new DefaultTreeSelectionModel();
+ dtsm.setSelectionMode(DefaultTreeSelectionModel.SINGLE_TREE_SELECTION);
+ tree.setSelectionModel(dtsm);
+
return tree;
}
diff --git a/examples/gnu/classpath/examples/swing/GNULookAndFeel.java b/examples/gnu/classpath/examples/swing/GNULookAndFeel.java
index 9c8e4c310..97e91a89f 100644
--- a/examples/gnu/classpath/examples/swing/GNULookAndFeel.java
+++ b/examples/gnu/classpath/examples/swing/GNULookAndFeel.java
@@ -15,16 +15,18 @@ General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
*/
package gnu.classpath.examples.swing;
import java.awt.Color;
+import javax.swing.ImageIcon;
import javax.swing.UIDefaults;
import javax.swing.plaf.ColorUIResource;
+import javax.swing.plaf.IconUIResource;
import javax.swing.plaf.basic.BasicLookAndFeel;
public class GNULookAndFeel extends BasicLookAndFeel
@@ -40,6 +42,8 @@ public class GNULookAndFeel extends BasicLookAndFeel
static UIDefaults LAF_defaults;
+ private final static String iconspath = "/gnu/javax/swing/plaf/gtk/icons/";
+
public UIDefaults getDefaults()
{
if (LAF_defaults == null)
@@ -59,7 +63,20 @@ public class GNULookAndFeel extends BasicLookAndFeel
"Menu.background", new ColorUIResource(blueGray),
"MenuBar.background", new ColorUIResource(blueGray),
"MenuItem.background", new ColorUIResource(blueGray),
- "ScrollBar.background", new ColorUIResource(blueGray)
+ "ScrollBar.background", new ColorUIResource(blueGray),
+
+ "Tree.closedIcon",
+ new IconUIResource(new ImageIcon
+ (getClass().getResource
+ (iconspath + "TreeClosed.png"))),
+ "Tree.leafIcon",
+ new IconUIResource(new ImageIcon
+ (getClass().getResource
+ (iconspath + "TreeLeaf.png"))),
+ "Tree.openIcon",
+ new IconUIResource(new ImageIcon
+ (getClass().getResource
+ (iconspath + "TreeOpen.png"))),
};
LAF_defaults.putDefaults(myDefaults);
}