|
Java example source code file (GUI.java)
The GUI.java Java example source code/* * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ /* * This source code is provided to illustrate the usage of a given feature * or technique and has been deliberately simplified. Additional steps * required for a production-quality application, such as security checks, * input validation and proper error handling, might not be present in * this sample code. */ package com.sun.tools.example.debug.gui; import java.io.*; import javax.swing.*; import javax.swing.border.*; import java.awt.*; import java.awt.event.*; import com.sun.jdi.*; import com.sun.tools.example.debug.bdi.*; public class GUI extends JPanel { private static final long serialVersionUID = 3292463234530679091L; private CommandTool cmdTool; private ApplicationTool appTool; //###HACK## //### There is currently dirty code in Environment that //### accesses this directly. //private SourceTool srcTool; public static SourceTool srcTool; private SourceTreeTool sourceTreeTool; private ClassTreeTool classTreeTool; private ThreadTreeTool threadTreeTool; private StackTraceTool stackTool; private MonitorTool monitorTool; public static final String progname = "javadt"; public static final String version = "1.0Beta"; //### FIX ME. public static final String windowBanner = "Java(tm) platform Debug Tool"; private Font fixedFont = new Font("monospaced", Font.PLAIN, 10); private GUI(Environment env) { setLayout(new BorderLayout()); setBorder(new EmptyBorder(5, 5, 5, 5)); add(new JDBToolBar(env), BorderLayout.NORTH); srcTool = new SourceTool(env); srcTool.setPreferredSize(new java.awt.Dimension(500, 300)); srcTool.setTextFont(fixedFont); stackTool = new StackTraceTool(env); stackTool.setPreferredSize(new java.awt.Dimension(500, 100)); monitorTool = new MonitorTool(env); monitorTool.setPreferredSize(new java.awt.Dimension(500, 50)); JSplitPane right = new JSplitPane(JSplitPane.VERTICAL_SPLIT, srcTool, new JSplitPane(JSplitPane.VERTICAL_SPLIT, stackTool, monitorTool)); sourceTreeTool = new SourceTreeTool(env); sourceTreeTool.setPreferredSize(new java.awt.Dimension(200, 450)); classTreeTool = new ClassTreeTool(env); classTreeTool.setPreferredSize(new java.awt.Dimension(200, 450)); threadTreeTool = new ThreadTreeTool(env); threadTreeTool.setPreferredSize(new java.awt.Dimension(200, 450)); JTabbedPane treePane = new JTabbedPane(SwingConstants.BOTTOM); treePane.addTab("Source", null, sourceTreeTool); treePane.addTab("Classes", null, classTreeTool); treePane.addTab("Threads", null, threadTreeTool); JSplitPane centerTop = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, treePane, right); cmdTool = new CommandTool(env); cmdTool.setPreferredSize(new java.awt.Dimension(700, 150)); appTool = new ApplicationTool(env); appTool.setPreferredSize(new java.awt.Dimension(700, 200)); JSplitPane centerBottom = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cmdTool, appTool); // centerBottom.setPreferredSize(new java.awt.Dimension(700, 350)); JSplitPane center = new JSplitPane(JSplitPane.VERTICAL_SPLIT, centerTop, centerBottom); add(center, BorderLayout.CENTER); } private static void usage() { String separator = File.pathSeparator; System.out.println("Usage: " + progname + " <options> Other Java examples (source code examples)Here is a short list of links related to this Java GUI.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.