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


Java JFrame.setTitle方法代码示例

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


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

示例1: displayCalibrationStatus

import javax.swing.JFrame; //导入方法依赖的package包/类
@Override
protected void displayCalibrationStatus(JFrame frame) throws Exception {
      	CalibrationStatusDisplay calibDisplay = 
      			new CalibrationStatusDisplay(frame, calibrationPoints,new java.awt.geom.Point2D.Double[9]);
      	frame.setMinimumSize(new Dimension(600,300));
      	
      	frame.add(calibDisplay);
      	
      	frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
      	frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
      	frame.setVisible(true);
      	frame.setTitle("Calibration: "+new Date());
      	Insets insets = frame.getInsets();
      	int width = frame.getSize().width-(insets.left+insets.right);
      	int height = frame.getSize().height-(insets.top+insets.bottom);
      	calibDisplay.windowDimension = new Dimension(width,height);
      	frame.toFront();
      	calibDisplay.repaint();
}
 
开发者ID:SERESLab,项目名称:iTrace-Archive,代码行数:20,代码来源:SystemMouseTracker.java

示例2: makeGui

import javax.swing.JFrame; //导入方法依赖的package包/类
private void makeGui()
{
	JFrame meinJFrame = new JFrame();
       meinJFrame.setTitle("JButton Beispiel");
       JPanel panel = new JPanel();

       // JButton mit Text "Drück mich" wird erstellt
       JButton button = new JButton("Drück mich");

       // JButton wird dem Panel hinzugefügt
       panel.add(button);

       meinJFrame.add(panel);

       // Fenstergröße wird so angepasst, dass 
       // der Inhalt reinpasst    
       meinJFrame.pack();

       meinJFrame.setVisible(true);
}
 
开发者ID:Nielko,项目名称:MBSE-Vacation-Manager,代码行数:21,代码来源:CalenderImplCustom.java

示例3: doShowKernels

import javax.swing.JFrame; //导入方法依赖的package包/类
public void doShowKernels() {
    if (apsDvsNet != null) {
        if (!apsDvsNet.networkRanOnce) {
            JOptionPane.showMessageDialog(chip.getAeViewer().getFilterFrame(), "Network must run at least once to correctly plot kernels (internal variables for indexing are computed at runtime)");
            return;
        }
        final DeepLearnCnnNetwork_HJ ref = apsDvsNet;
        Runnable runnable = new Runnable() {
            @Override
            public void run() {
                try {
                    setCursor(new Cursor(Cursor.WAIT_CURSOR));
                    JFrame frame = apsDvsNet.drawKernels();
                    frame.setTitle("APS net kernel weights");
                } finally {
                    setCursor(Cursor.getDefaultCursor());
                }
            }

        };
        SwingUtilities.invokeLater(runnable);
    }
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:24,代码来源:DavisDeepLearnCnnProcessor_HJ.java

示例4: doShowKernels

import javax.swing.JFrame; //导入方法依赖的package包/类
public void doShowKernels() {
    if (apsDvsNet != null) {
        if (!apsDvsNet.networkRanOnce) {
            JOptionPane.showMessageDialog(chip.getAeViewer().getFilterFrame(), "Network must run at least once to correctly plot kernels (internal variables for indexing are computed at runtime)");
            return;
        }
        Runnable runnable = new Runnable() {
            @Override
            public void run() {
                try {
                    if (apsDvsNet != null) {
                        setCursor(new Cursor(Cursor.WAIT_CURSOR));
                        JFrame frame = apsDvsNet.drawKernels();
                        frame.setTitle("APS net kernel weights");
                    }
                } finally {
                    setCursor(Cursor.getDefaultCursor());
                }
            }
        };
        SwingUtilities.invokeLater(runnable);
    }
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:24,代码来源:AbstractDavisCNNProcessor.java

示例5: Gui1

import javax.swing.JFrame; //导入方法依赖的package包/类
public Gui1(BufferedImage Image1, BufferedImage Image2){
	JFrame guiFrame = new JFrame();
	guiFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	guiFrame.setTitle("Maze Solver GUI");
	guiFrame.setSize(650,680);
	guiFrame.setLocationRelativeTo(null);

	//final JPanel comboPanel = new	JPanel();
	iconPanel comboPanel = new iconPanel(Image1);
	comboPanel.setAlt(Image2);
	JButton Button1 = new JButton( "Premi per cambiare");
	Button1.addActionListener(new ActionListener(){
		@Override
		public void actionPerformed(ActionEvent event){
			//comboPanel.setVisible(!comboPanel.isVisible());
			//comboPanel.buff = image2;
			comboPanel.imgS();
		}
	});

	guiFrame.add(comboPanel, BorderLayout.NORTH);
	guiFrame.add(Button1,BorderLayout.SOUTH);
	guiFrame.setVisible(true);
}
 
开发者ID:MotAtlas,项目名称:MazeSolver,代码行数:25,代码来源:Gui1.java

示例6: ExtractWindow

import javax.swing.JFrame; //导入方法依赖的package包/类
public ExtractWindow(String zipName, Logger log) {
	this.zipName = zipName;
	this.log = log;

	frame = new JFrame();
	frame.setTitle("Extracting Files");
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frame.setSize(300, 80);
	frame.setLocationRelativeTo(null);
	frame.setResizable(false);
	frame.setLayout(null);
	
	panel = new JPanel();
	frame.add(panel);
	
	init();
}
 
开发者ID:JudgeGlass,项目名称:Install_Builder_Universal,代码行数:18,代码来源:ExtractWindow.java

示例7: InputGUI

import javax.swing.JFrame; //导入方法依赖的package包/类
public InputGUI(CommandLineOptions ops) {
    Thread splash = new Thread(new SplashScreen());
    splash.start();

    System.setErr(errs);
    pt = new Thread();

    guiFrame = new JFrame();
    guiFrame.setTitle("TuLiPA " + InputGUI.VERSION);
    guiFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    guiFrame.setJMenuBar(getMenuBar());
    guiFrame.setContentPane(getContainer());
    guiFrame.pack();
    guiFrame.setResizable(false);
    guiFrame.setLocationRelativeTo(null);

    shellFrame = new JFrame();
    shellFrame.setTitle("TuLiPA shell");
    shellFrame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
    shellFrame.setContentPane(auxshell);
    shellFrame.setSize(new Dimension(400, 300));
    shellFrame.setResizable(true);
    shellFrame.setLocationRelativeTo(guiFrame);

    this.setOps(ops);
    localops = null;

    guiFrame.setVisible(true);

}
 
开发者ID:spetitjean,项目名称:TuLiPA-frames,代码行数:31,代码来源:InputGUI.java

示例8: AboutWindow

import javax.swing.JFrame; //导入方法依赖的package包/类
public AboutWindow() {
	frame = new JFrame();
	frame.setTitle("About");
	frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
	frame.setSize(325, 280);
	frame.setLocationRelativeTo(null);
	frame.setResizable(false);
	frame.setLayout(null);
	
	panel = new JPanel();
	frame.add(panel);
	
	initialize();
	frame.setVisible(true);
}
 
开发者ID:JudgeGlass,项目名称:Install_Builder_Universal,代码行数:16,代码来源:AboutWindow.java

示例9: LogWindow

import javax.swing.JFrame; //导入方法依赖的package包/类
public LogWindow() {
	frame = new JFrame();
	frame.setTitle("Latest Log");
	frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
	frame.setSize(600, 480);
	frame.setLocationRelativeTo(null);
	frame.setResizable(false);
	frame.setLayout(null);
	
	panel = new JPanel();
	frame.add(panel);
	
	init();
}
 
开发者ID:JudgeGlass,项目名称:Install_Builder_Universal,代码行数:15,代码来源:LogWindow.java

示例10: initialize

import javax.swing.JFrame; //导入方法依赖的package包/类
/**
 * Initializes the GUI.
 */
private void initialize(){
	Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
	
	// error window
	windowError = new JFrame();	
	windowError.setBounds(100, 100, 300, 145);
	windowError.setLocation(dim.width/2-windowError.getSize().width/2, dim.height/2-windowError.getSize().height/2);
	windowError.setResizable(false);
	windowError.setTitle("Ladder Tracker v" + version);
	windowError.setIconImage(new ImageIcon(getClass().getResource("icon.png")).getImage());
	windowError.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	windowError.getContentPane().setLayout(null);
	
	// button retry
	buttonRetry = new JButton("Retry");
	buttonRetry.setBounds(10, 80, 274, 23);
	buttonRetry.addActionListener(buttonRetryListener);
	windowError.getContentPane().add(buttonRetry);
	
	// error text 
	JTextPane textError = new JTextPane();
	textError.setText(errorMessage);
	textError.setEditable(false);
	textError.setBackground(SystemColor.menu);
	textError.setBounds(10, 21, 274, 39);
	windowError.getContentPane().add(textError);
}
 
开发者ID:jkjoschua,项目名称:poe-ladder-tracker-java,代码行数:31,代码来源:GUIError.java

示例11: GameArena

import javax.swing.JFrame; //导入方法依赖的package包/类
/**
    * Constructor. Creates an instance of the GameArena class, and displays a window on the
    * screen upon which shapes can be drawn.
    *
    * @param width The width of the window, in pixels.
    * @param height The height of the window, in pixels.
 */
public GameArena(int width, int height)
{   
       this.arenaWidth = width;
       this.arenaHeight = height;
       this.objectCount = 0;

       // Create a window
       window = new JFrame();
       window.setTitle("Let's Play!");

       // Create a JavaFX canvas as a Swing panel.
       jfxPanel = new JFXPanel();
       jfxPanel.setPreferredSize(new java.awt.Dimension(width, height));

       window.setContentPane(jfxPanel);
       window.setResizable(false);
       window.pack();
       window.setVisible(true);
       window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

       root = new Group();
       scene = new Scene(root, arenaWidth, arenaHeight, Color.BLACK);

       Platform.runLater(new Runnable() {
           @Override
           public void run() {
               initFX();
           }
       });
}
 
开发者ID:finneyj,项目名称:GameArena,代码行数:38,代码来源:GameArena.java

示例12: MainFrame

import javax.swing.JFrame; //导入方法依赖的package包/类
public MainFrame(){
    JFrame frame = new JFrame("MigLayout Basic");

    frame.setTitle("Battleship - WarZone");
    frame.setSize(1200,800); //Set size for new panel
    frame.setLocationRelativeTo(null); //Center
    frame.setResizable(true);
    frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    frame.setContentPane(mainView); //Set main panel
    frame.setVisible(true);

}
 
开发者ID:arthurdeschamps,项目名称:battleship,代码行数:13,代码来源:MainFrame.java

示例13: viewGraph

import javax.swing.JFrame; //导入方法依赖的package包/类
public static void viewGraph(int one, int two) {
	JFrame f = new JFrame();
	f.setSize(500, 400);
	f
			.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

	f.setTitle("Group Signature Graph");
	double[] values = new double[2];
	String[] names = new String[2];
	values[0] = one;
	names[0] = "Existed System";

	values[1] = two;
	names[1] = "Praposed System";

	f.getContentPane()
			.add(
					new ChartPanel(values, names,
							"Group Signature Genereted Graph"));

	WindowListener wndCloser = new WindowAdapter() {
		public void windowClosing(WindowEvent e) {
			System.exit(0);
		}
	};
	f.addWindowListener(wndCloser);
	f.setVisible(true);
}
 
开发者ID:cyberheartmi9,项目名称:Mona-Secure-Multi-Owner-Data-Sharing-for-Dynamic-Group-in-the-Cloud,代码行数:29,代码来源:ChartPanel.java

示例14: SimpleGUI

import javax.swing.JFrame; //导入方法依赖的package包/类
/** The constructor; this method will be called by the AWT event thread, using the "invokeLater" method. */
private SimpleGUI (final String[] args) {

    // Register an exception handler for uncaught exceptions
    MailBug.setup();

    // Enable better look-and-feel
    if (Util.onMac() || Util.onWindows()) {
        System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Alloy Analyzer "+Version.version());
        System.setProperty("com.apple.mrj.application.growbox.intrudes","true");
        System.setProperty("com.apple.mrj.application.live-resize","true");
        System.setProperty("com.apple.macos.useScreenMenuBar","true");
        System.setProperty("apple.laf.useScreenMenuBar","true");
        try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Throwable e) { }
    }

    // Figure out the desired x, y, width, and height
    int screenWidth=OurUtil.getScreenWidth(), screenHeight=OurUtil.getScreenHeight();
    int width=AnalyzerWidth.get();
    if (width<=0) width=screenWidth/10*8; else if (width<100) width=100;
    if (width>screenWidth) width=screenWidth;
    int height=AnalyzerHeight.get();
    if (height<=0) height=screenHeight/10*8; else if (height<100) height=100;
    if (height>screenHeight) height=screenHeight;
    int x=AnalyzerX.get(); if (x<0) x=screenWidth/10; if (x>screenWidth-100) x=screenWidth-100;
    int y=AnalyzerY.get(); if (y<0) y=screenHeight/10; if (y>screenHeight-100) y=screenHeight-100;

    // Put up a slash screen
    final JFrame frame = new JFrame("Alloy Analyzer");
    frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
    frame.pack();
    if (!Util.onMac() && !Util.onWindows()) {
       String gravity = System.getenv("_JAVA_AWT_WM_STATIC_GRAVITY");
       if (gravity==null || gravity.length()==0) {
          // many Window managers do not respect ICCCM2; this should help avoid the Title Bar being shifted "off screen"
          if (x<30) { if (x<0) x=0; width=width-(30-x);   x=30; }
          if (y<30) { if (y<0) y=0; height=height-(30-y); y=30; }
       }
       if (width<100) width=100;
       if (height<100) height=100;
    }
    frame.setSize(width,height);
    frame.setLocation(x,y);
    frame.setVisible(true);
    frame.setTitle("Alloy Analyzer "+Version.version()+" loading... please wait...");
    final int windowWidth = width;
    // We intentionally call setVisible(true) first before settings the "please wait" title,
    // since we want the minimized window title on Linux/FreeBSD to just say Alloy Analyzer

    // Test the allowed memory sizes
    final WorkerEngine.WorkerCallback c = new WorkerEngine.WorkerCallback() {
        private final List<Integer> allowed = new ArrayList<Integer>();
        private final List<Integer> toTry = new ArrayList<Integer>(Arrays.asList(256,512,768,1024,1536,2048,2560,3072,3584,4096));
        private int mem;
        public synchronized void callback(Object msg) {
            if (toTry.size()==0) {
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() { SimpleGUI.this.frame=frame; SimpleGUI.this.finishInit(args, allowed, windowWidth); }
                });
                return;
            }
            try { mem=toTry.remove(0); WorkerEngine.stop(); WorkerEngine.run(dummyTask, mem, 128, "", "", this); return; } catch(IOException ex) { fail(); }
        }
        public synchronized void done() {
            //System.out.println("Alloy4 can use "+mem+"M"); System.out.flush();
            allowed.add(mem);
            callback(null);
        }
        public synchronized void fail() {
            //System.out.println("Alloy4 cannot use "+mem+"M"); System.out.flush();
            callback(null);
        }
    };
    c.callback(null);
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:76,代码来源:SimpleGUI.java

示例15: EditorPaneDemo

import javax.swing.JFrame; //导入方法依赖的package包/类
public EditorPaneDemo(Language language, boolean maintainLookbacks,
String initialContent) {

    super(new PlainDocument(), language, maintainLookbacks);
    
    JFrame frame = new JFrame();
    frame.addWindowListener(new java.awt.event.WindowAdapter() {
        public void windowClosing(java.awt.event.WindowEvent evt) {
            System.exit(0);
        }
    });

    frame.setTitle("Test of " + splitClassName(language.getClass().getName())[1]
        + " - Use Ctrl+L to dump tokens");

    JEditorPane jep = new JEditorPane();
    
    Document doc = getDocument();
    jep.setDocument(doc);
    // Insert initial content string
    try {
        if (initialContent != null) {
            doc.insertString(0, initialContent, null);
        }
    } catch (BadLocationException e) {
        e.printStackTrace();
        return;
    }
    
    // Initially debug token changes
    setDebugTokenChanges(true);

    frame.getContentPane().add(jep);
    
    DumpAction da = new DumpAction();
    jep.registerKeyboardAction(da,
        KeyStroke.getKeyStroke(KeyEvent.VK_L, InputEvent.CTRL_MASK), 0);
    
    DebugTokenChangesAction dtca = new DebugTokenChangesAction();
    jep.registerKeyboardAction(dtca,
        KeyStroke.getKeyStroke(KeyEvent.VK_T, InputEvent.CTRL_MASK), 0);
    
    
    System.err.println("NOTE: Press Ctrl+L to dump the document's token list.\n");
    System.err.println("      Press Ctrl+T to toggle debugging of token changes.\n");
    
    // Debug initially
    dump();

    frame.setSize(400, 300);
    frame.setVisible(true);
    
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:54,代码来源:EditorPaneDemo.java


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