📄 wireframeswingexample.java
字号:
//===========================================================================// Awt / swing classesimport java.applet.Applet;import java.awt.BorderLayout;import java.awt.Dimension;import javax.swing.JFrame;/**Note that this program is designed to work as a java application, or as ajava applet. If current class does not extends from Applet, and `init` methodis deleted, this will continue working as a simple java application.This is a simple programme recommended for use as a template in the developmentof VitralSDK programs by incremental modification.*/public class WireframeSwingExample extends Applet{ public boolean appletMode; public SwingCanvas canvas; /** When running this class inside a browser (in applet mode) there is no warranty of calling this method, or calling before init. It is recommended that real initialization be done in another `createModel` method, and that such method be called explicity from entry point function. */ public WireframeSwingExample() { // Empty! call `createModel` explicity from entry point function! ; } private void createGUI() { canvas = new SwingCanvas(appletMode); } public static void main (String[] args) { // Common VitralSDK initialization WireframeSwingExample instance = new WireframeSwingExample(); instance.appletMode = false; // Create application based GUI JFrame frame; Dimension size; instance.createGUI(); frame = new JFrame("VITRAL concept test - Camera control example"); frame.add(instance.canvas, BorderLayout.CENTER); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); size = new Dimension(640, 480); //frame.setMinimumSize(size); frame.setSize(size); frame.setVisible(true); instance.canvas.requestFocusInWindow(); } public void init() { appletMode = true; setLayout(new BorderLayout()); createGUI(); add("Center", canvas); }}//===========================================================================//= EOF =//===========================================================================
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -