⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jxframe.java

📁 java实现浏览器等本地桌面的功能
💻 JAVA
字号:
/* * $Id: JXFrame.java,v 1.6 2005/10/12 11:26:57 kleopatra Exp $ * * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle, * Santa Clara, California 95054, U.S.A. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. *  * This library 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 * Lesser General Public License for more details. *  * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */package org.jdesktop.swingx;import java.awt.Component;import javax.swing.JFrame;import javax.swing.JRootPane;/** * A smarter JFrame specifically used for top level frames for Applications. * This frame uses a JXRootPane. */public class JXFrame extends JFrame {    public JXFrame() {        this(null, false);    }        public JXFrame(String title, boolean exitOnClose) {        super(title);        if (exitOnClose) {            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);        }    }    public JXFrame(String title) {        this(title, false);    }    /**     * Overloaded to create a JXRootPane.     */    protected JRootPane createRootPane() {        return new JXRootPane();    }    /**     * Overloaded to make this public.     */    public void setRootPane(JRootPane root) {        super.setRootPane(root);    }    /**     * Add a component to the Frame.     */    public void addComponent(Component comp) {        JXRootPane root = getRootPaneExt();        if (root != null) {            root.addComponent(comp);        }        // XXX should probably fire some sort of container event.    }    /**     * Removes a component from the frame.     */    public void removeComponent(Component comp) {        JXRootPane root = getRootPaneExt();        if (root != null) {            root.removeComponent(comp);        }        // XXX should probably fire some sort of container event.    }    /**     * Return the extended root pane. If this frame doesn't contain     * an extended root pane the root pane should be accessed with     * getRootPane().     *     * @return the extended root pane or null.     */    public JXRootPane getRootPaneExt() {        if (rootPane instanceof JXRootPane) {            return (JXRootPane)rootPane;        }        return null;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -