当前位置: 首页>>代码示例>>Java>>正文


Java JFrame.show方法代码示例

本文整理汇总了Java中javax.swing.JFrame.show方法的典型用法代码示例。如果您正苦于以下问题:Java JFrame.show方法的具体用法?Java JFrame.show怎么用?Java JFrame.show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JFrame的用法示例。


在下文中一共展示了JFrame.show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import javax.swing.JFrame; //导入方法依赖的package包/类
public static void main(String[] args) {
	javax.swing.JFileChooser c = new javax.swing.JFileChooser(
			System.getProperty( "user.dir" ));
	int ok = c.showOpenDialog(null);
	if( ok==c.CANCEL_OPTION) System.exit(0);
	File f = c.getSelectedFile();
	String path = f.getParent();
	String prefix = f.getName();
	prefix = prefix.substring(0, prefix.indexOf(".dbf"));
	try {
		DBFFile dbf = new DBFFile(path, prefix);
		JTable t = new JTable(dbf);
		JFrame frame = new JFrame(f.getName());
		frame.getContentPane().add(new JScrollPane(t));
		frame.pack();
		frame.show();
		frame.setDefaultCloseOperation(frame.EXIT_ON_CLOSE);
	} catch(IOException ex) {
		ex.printStackTrace();
		System.exit(-1);
	}
//	System.exit(0);
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:24,代码来源:DBFFile.java

示例2: main

import javax.swing.JFrame; //导入方法依赖的package包/类
public static void main(String[] args) {
	ShapeSuite suite = new ShapeSuite();
	try {
		suite.addShapeFile();
	} catch(IOException e) {
		e.printStackTrace(System.err);
		System.exit(0);
	}
	MapApp app = new MapApp(MapApp.MERCATOR_MAP);
	suite.setMap( app.getMap() );
	suite.setParent( app.getMap().getTopLevelAncestor(), null );
	JTable table = new JTable(suite);
	JFrame frame = new JFrame();
	frame.getContentPane().add(new JScrollPane(table));
	frame.pack();
	frame.show();
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:18,代码来源:ShapeSuite.java

示例3: main

import javax.swing.JFrame; //导入方法依赖的package包/类
public static void main(String[] args) {
	float[] data = new float[1000];
	for(int k=0 ; k<1000 ; k++) data[k]=(float)Math.random();
	SymbolScaleTool tools = new SymbolScaleTool(data, null);
	tools.addPropertyChangeListener( 
		new PropertyChangeListener() {
			public void propertyChange(PropertyChangeEvent evt) {
				System.out.println( evt.getPropertyName() );
			}
		});
//	tools.showDialog( (JFrame)null );
	JFrame frame = new JFrame("test");
	frame.getContentPane().add(tools);
	frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE);
	frame.pack();
	frame.show();
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:18,代码来源:SymbolScaleTool.java

示例4: WaitWindow

import javax.swing.JFrame; //导入方法依赖的package包/类
public WaitWindow(JFrame f) {
    f.addWindowListener(this);
    f.show();
    if (!shown) {
        synchronized(this) {
            try {
                //System.err.println("Waiting for window");
                wait(5000);
            } catch (Exception e) {}
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:FocusAfterBadEditTest.java

示例5: main

import javax.swing.JFrame; //导入方法依赖的package包/类
public static void main(String[] args) {
	try {
		JFileChooser c = new JFileChooser(System.getProperty("user.dir"));
		int ok = c.showOpenDialog(null);
		if( ok==c.CANCEL_OPTION )System.exit(0);
		GTable t = new GTable(c.getSelectedFile());
		XBTable table = t.createTable();
		table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
		table.setScrollableTracksViewportWidth(false);

		MapApp app = null;
		if( args.length>0 ) {
			PC pc = new PC();
			app = pc.getApp();
		} else {
			app = new MapApp();
		}
		XMap map = app.getMap();
		t.setMap( map);

		map.addOverlay( t );

		JFrame f = new JFrame( c.getSelectedFile().getName() );
		f.getContentPane().add(new JScrollPane(table));
		f.pack();
		f.show();
	//	f.setDefaultCloseOperation(f.EXIT_ON_CLOSE);
		map.repaint();
	} catch(Throwable e) {
		e.printStackTrace();
		System.exit(-1);
	}
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:34,代码来源:GTable.java

示例6: WaitWindow

import javax.swing.JFrame; //导入方法依赖的package包/类
public WaitWindow(JFrame f) {
    f.addWindowListener(this);
    f.show();
    if (!shown) {
        synchronized(this) {
            try {
                wait(5000);
            } catch (Exception e) {}
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:ComboTest.java

示例7: main

import javax.swing.JFrame; //导入方法依赖的package包/类
/**
     * @param g
     * @param startup
     * @param layout
     * @param d
     */
    public static void main( String[] s ) {
//        StaticLayout start = new CircleLayout();
        StaticLayout end = new IterableToStaticLayout(new CircleLayout(), new KKLayout());
        Graph g = TestGraphs.getDemoGraph(); 
        Dimension d = new Dimension( 200, 200);
        end.initializeLocations(d, g);
        VertexRenderer vr = new SimpleVertexRenderer();
        EdgeRenderer er = new SimpleEdgeRenderer();
        
        GraphLayoutPanel jgp = new GraphLayoutPanel(g, d, vr, er);
        jgp.addClickListener(new ClickListener() {

            public void edgeClicked(ClickEvent ece) {
                System.out.println( ece );
            }

            public void vertexClicked(ClickEvent vce) {
                System.out.println( vce );
            }           
            
        });
        jgp.setLayoutDisplay( end.emit() );
        
        JFrame jf = new JFrame();
        jf.getContentPane().add( jgp );
        jf.pack();
        jf.show();
        jf.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
    }
 
开发者ID:dev-cuttlefish,项目名称:cuttlefish,代码行数:36,代码来源:StaticGraphDraw.java

示例8: main

import javax.swing.JFrame; //导入方法依赖的package包/类
public static void main(String[] args) {
	try {
		JFileChooser c = new JFileChooser(System.getProperty("user.dir"));
		int ok = c.showOpenDialog(null);
		if( ok==c.CANCEL_OPTION )System.exit(0);
		GMATable t = new GMATable(c.getSelectedFile());
		XBTable table = t.createTable();
		table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
		table.setScrollableTracksViewportWidth(false);

		MapApp app = null;
		if( args.length>0 ) {
			PC pc = new PC();
			app = pc.getApp();
		} else {
			app = new MapApp();
		}
		XMap map = app.getMap();
		t.setMap( map);

		map.addOverlay( t );

		JFrame f = new JFrame( c.getSelectedFile().getName() );
		f.getContentPane().add(new JScrollPane(table));
		f.pack();
		f.show();
	//	f.setDefaultCloseOperation(f.EXIT_ON_CLOSE);
		map.repaint();
	} catch(Throwable e) {
		e.printStackTrace();
		System.exit(-1);
	}
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:34,代码来源:GMATable.java

示例9: main

import javax.swing.JFrame; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    JFrame frame = new JFrame("OpenCL Editor");
    frame.setResizable(true);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    DicomViewer ch = new DicomViewer();
    ch.setPreferredSize(new Dimension(800, 600));
    frame.setLayout(new BorderLayout());
    frame.add(ch, BorderLayout.CENTER);
    frame.pack();
    frame.show();
    ch.onLoadProgram();
}
 
开发者ID:iapafoto,项目名称:DicomViewer,代码行数:13,代码来源:DicomViewer.java

示例10: main

import javax.swing.JFrame; //导入方法依赖的package包/类
public static void main(String[] args) {
	BalancePanel bp = new BalancePanel();
	bp.addPropertyChangeListener( 
		new java.beans.PropertyChangeListener() {
			public void propertyChange(java.beans.PropertyChangeEvent evt) {
				System.out.println(evt.getPropertyName());
			}
		});
	JFrame colorDialog = new JFrame( "color balance" );
	colorDialog.getContentPane().add( bp );
	colorDialog.pack();
	colorDialog.show();
	colorDialog.setDefaultCloseOperation( colorDialog.EXIT_ON_CLOSE );
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:15,代码来源:BalancePanel.java

示例11: performDefaultAction

import javax.swing.JFrame; //导入方法依赖的package包/类
public void performDefaultAction (Object node) {
    try {
        JFrame f = new JFrame ("View");
        f.getContentPane ().add (new JEditorPane (((File) node).toURL ()));
        f.pack ();
        f.show ();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:TreeModelExample3.java

示例12: main

import javax.swing.JFrame; //导入方法依赖的package包/类
public static void main (String[] args) {
    TreeModelExample3 tme = new TreeModelExample3 ();
    JComponent ttv = Models.createView (
        tme,              // TreeModel
        tme,              // NodeModel
        null,             // TableModel
        tme,              // NodeActionsProvider
        new ArrayList ()  // list of ColumnModels
    );
    JFrame f = new JFrame ("Tree Model Example 3");
    f.getContentPane ().add (ttv);
    f.pack ();
    f.show ();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:TreeModelExample3.java

示例13: main

import javax.swing.JFrame; //导入方法依赖的package包/类
public static void main (String[] args) {
    TreeModelExample4 tme = new TreeModelExample4 ();
    ArrayList columns = new ArrayList ();
    columns.add (new ColumnModel () {
        public String getID () {
            return "sizeID";
        }

        public String getDisplayName () {
            return "size";
        }

        public Class getType () {
            return String.class;
        }
    });
    JComponent ttv = Models.createView (
        tme,              // TreeModel
        tme,              // NodeModel
        tme,              // TableModel
        tme,              // NodeActionsProvider
        columns           // list of ColumnModels
    );
    JFrame f = new JFrame ("Tree Model Example 4");
    f.getContentPane ().add (ttv);
    f.pack ();
    f.show ();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:29,代码来源:TreeModelExample4.java

示例14: main

import javax.swing.JFrame; //导入方法依赖的package包/类
public static void main(String[] args) {
	StartUp s = new StartUp(1);
	JFrame frame = new JFrame("startup");
	frame.getContentPane().add(s);
	frame.pack();
	frame.show();
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:8,代码来源:StartUp.java

示例15: setUp

import javax.swing.JFrame; //导入方法依赖的package包/类
protected void setUp() throws Exception {
    // Create new TEditor
    te = new TEditor();
    // Create new TNode
    tn = new TNode();
    
    //Replacing NodeOp w/ JFrame to eliminate depending on full IDE init
    //and long delay while waiting for property sheet thus requested to
    //initialize
    final JFrame jf = new JFrame();
    ps = new PropertySheet();
    jf.getContentPane().setLayout(new BorderLayout());
    jf.getContentPane().add(ps, BorderLayout.CENTER);
    jf.setLocation(30,30);
    jf.setSize(500,500);
    
    SwingUtilities.invokeAndWait(new Runnable() {
        public void run() {
            ps.setNodes(new Node[] {tn});
            //ps.setCurrentNode(tn);
            jf.show();
        }
    });
    
    jf.show();
    new ExtTestCase.WaitWindow(jf);
    
    try {
        // Wait for the initialization
        for (int i = 0; i < 10; i++) {
            final String asText = te.getAsText();
            if (asText == null || asText.equals("null")) {
                //System.out.println("null");
                Thread.sleep(1000);
            } else break;
        }
        ensurePainted(ps);
        
    } catch (Exception e) {
        fail("FAILED - Exception thrown "+e.getClass().toString());
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:43,代码来源:IndexedPropertyTest.java


注:本文中的javax.swing.JFrame.show方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。