Java Code Examples for javax.swing.JFrame.setTitle()

The following are Jave code examples for showing how to use setTitle() of the javax.swing.JFrame class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: iTrace-Archive   File: SystemMouseTracker.java   View Source Code Vote up 7 votes
@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();
}
 
Example 2
Project: MBSE-Vacation-Manager   File: CalenderImplCustom.java   View Source Code Vote up 6 votes
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);
}
 
Example 3
Project: jaer   File: DavisDeepLearnCnnProcessor_HJ.java   View Source Code Vote up 6 votes
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);
    }
}
 
Example 4
Project: jaer   File: AbstractDavisCNNProcessor.java   View Source Code Vote up 6 votes
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);
    }
}
 
Example 5
Project: MazeSolver   File: Gui1.java   View Source Code Vote up 6 votes
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);
}
 
Example 6
Project: Install_Builder_Universal   File: ExtractWindow.java   View Source Code Vote up 6 votes
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();
}
 
Example 7
Project: TuLiPA-frames   File: InputGUI.java   View Source Code Vote up 5 votes
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);

}
 
Example 8
Project: Install_Builder_Universal   File: AboutWindow.java   View Source Code Vote up 5 votes
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);
}
 
Example 9
Project: Install_Builder_Universal   File: LogWindow.java   View Source Code Vote up 5 votes
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();
}
 
Example 10
Project: poe-ladder-tracker-java   File: GUIError.java   View Source Code Vote up 5 votes
/**
 * 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);
}
 
Example 11
Project: GameArena   File: GameArena.java   View Source Code Vote up 5 votes
/**
    * 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();
           }
       });
}
 
Example 12
Project: battleship   File: MainFrame.java   View Source Code Vote up 5 votes
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);

}
 
Example 13
Project: Mona-Secure-Multi-Owner-Data-Sharing-for-Dynamic-Group-in-the-Cloud   File: ChartPanel.java   View Source Code Vote up 5 votes
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);
}
 
Example 14
Project: Tarski   File: SimpleGUI.java   View Source Code Vote up 4 votes
/** 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);
}
 
Example 15
Project: incubator-netbeans   File: EditorPaneDemo.java   View Source Code Vote up 4 votes
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);
    
}
 
Example 16
Project: Wilmersdorf_SER316   File: AppFrame.java   View Source Code Vote up 4 votes
public void configureSMSFunctionality()
  {
  	System.out.println("configurateSMSFunctionality called");
  	JPanel topSMSPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
  	JPanel centerSMSPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
  	JPanel bottomSMSPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
  	
  	SMSGui = new JFrame();
SMSGui.setSize(450, 200);
SMSGui.setLayout(new FlowLayout(FlowLayout.LEFT));
SMSGui.setTitle("Configure SMS Reminders");
SMSGui.setLocationRelativeTo(null);

   JLabel spacer = new JLabel("       ");//spacer
  	JLabel phoneNumberPrompt = new JLabel("Phone Number:");
  	JLabel carrierPrompt = new JLabel("Select Carrier:");
  	JLabel passwordPrompt = new JLabel("Password:");
  	passwordField = new JTextField(10);
  	passwordField.setToolTipText("Password is Memoranda");
  	phoneNumberField = new JTextField(10);
  	carrierList = new JComboBox<String>();
  	carrierList.addItem("T-Mobile");//@tmomail.net 
  	carrierList.addItem("Sprint");//@messaging.sprintpcs.com
  	carrierList.addItem("Verizon");//@vtext.com
  	carrierList.addItem("Virgin");//@vmobl.com
  	carrierList.addItem("Cingular");//@cingularme.com
  	carrierList.addItem("Nextel");//@messaging.nextel.com
  	
      JButton setConfigurationButton = new JButton("Set Configuration");
      setConfigurationButton.addActionListener(captureSMSConfiguration);
      
      topSMSPanel.add(phoneNumberPrompt);
      topSMSPanel.add(phoneNumberField);
      
      centerSMSPanel.add(carrierPrompt);
      centerSMSPanel.add(carrierList);
      
      bottomSMSPanel.add(passwordPrompt);
      bottomSMSPanel.add(passwordField);
      bottomSMSPanel.add(spacer);
      bottomSMSPanel.add(setConfigurationButton);
      
      SMSGui.add(topSMSPanel);
      SMSGui.add(centerSMSPanel);
      SMSGui.add(bottomSMSPanel);
      
      SMSGui.setVisible(true);
  }
 
Example 17
Project: iTrace-Archive   File: EyeXTracker.java   View Source Code Vote up 4 votes
protected void displayCalibrationStatus(JFrame frame) throws Exception {
	 double[] pointsNormalized = jniGetCalibration();
	 
	 if (pointsNormalized == null)
		 throw new IOException("Can't get calibration data!");
	 
	 int zeros = 0;
	 for( double ord: pointsNormalized){
		 if( ord <= 0 || ord > 1) zeros++;
	 }
	 ArrayList<Point2D.Double> points = new ArrayList<Point2D.Double>();
	 ArrayList<Point2D.Double> invalidpoints = new ArrayList<Point2D.Double>();
	//if( zeros > 0 ) throw new IOException("zeros in points: "+zeros+"/"+pointsNormalized.length);
	 
	 int itemCount = pointsNormalized.length/4;

	 for( int i=0; i < itemCount; i++ ){
		 
		points.add(new Point2D.Double(pointsNormalized[i],pointsNormalized[i+itemCount]));
		points.add(new Point2D.Double(pointsNormalized[(2*itemCount)+i],pointsNormalized[i+(itemCount*3)]));
	 }
	 
	 Rectangle2D.Double rect = new Rectangle2D.Double(0.0,0.0,1.0,1.0);
	 
	 for(Point2D.Double p: points){
		 if( !rect.contains(p) ) invalidpoints.add(p);
	 }
	 
	 for (int i = 0; i < pointsNormalized.length; i++) {
		 if (pointsNormalized[i] < 0.0001) {
			 pointsNormalized[i] = 0.0001;
		 } else if (pointsNormalized[i] > 0.9999) {
			 pointsNormalized[i] = 0.9999;
		 } else {
    		//do nothing
		 }
	 }
    
	 Point2D.Double[] calibrationData = new Point2D.Double[itemCount+1];
	 for (int j = 0; j < itemCount; j+=2) {
		 calibrationData[j] = (new Point2D.Double(pointsNormalized[j],pointsNormalized[itemCount+j]));
		 if(j != itemCount)
			 calibrationData[j+1] = (new Point2D.Double(pointsNormalized[2*itemCount+j],pointsNormalized[3*itemCount+j]));
	 }
	 JFrame calibFrame = frame;
	 CalibrationStatusDisplay calibDisplay = 
			 new CalibrationStatusDisplay(calibFrame,calibrationPoints,calibrationData);
	 
	 calibFrame.add(calibDisplay);
    calibFrame.setUndecorated(false);
    calibFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    calibFrame.setExtendedState(JFrame.MAXIMIZED_BOTH);
    calibFrame.setMinimumSize(new Dimension(600,300));
    calibFrame.setTitle("Calibration: "+new Date());
    Insets insets = calibFrame.getInsets();
   	int width = calibFrame.getSize().width-(insets.left+insets.right);
   	int height = calibFrame.getSize().height-(insets.top+insets.bottom);
   	calibDisplay.windowDimension = new Dimension(width,height);
    calibFrame.setVisible(true);
    calibFrame.toFront();
    calibDisplay.repaint();
}
 
Example 18
Project: jreliability   File: ReliabilityViewer.java   View Source Code Vote up 4 votes
/**
 * Constructs and views {@link JFrame} with a given title and a list of {@link ReliabilityFunction}s.
 * 
 * @param title
 *            the title
 * @param reliabilityFunctions
 *            the reliabilityFunctions
 */
public static void view(String title, Map<String, ReliabilityFunction> reliabilityFunctions) {

	try {
		UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
	} catch (Exception e) {
		e.printStackTrace();
	}

	// Setup the aspects for the plot panel
	List<Aspect> aspects = new ArrayList<>();
	aspects.add(new ReliabilityFunctionAspect());
	aspects.add(new DistributionAspect());
	aspects.add(new DensityAspect());
	aspects.add(new FailureRateAspect());
	ReliabilityFunctionPlotPanel reliabilityFunctionPlotPanel = new ReliabilityFunctionPlotPanel(aspects);
	JPanel plotPanel = reliabilityFunctionPlotPanel.get(reliabilityFunctions);

	JPanel measuresPanel = new MeasuresPanel(reliabilityFunctions);

	JFrame frame = new JFrame();

	frame.setTitle(title);
	frame.setIconImage(getImageIcon().getImage());
	frame.setPreferredSize(new Dimension(1000, 500));
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

	Container content = frame.getContentPane();
	frame.setLayout(new GridBagLayout());
	GridBagConstraints c = new GridBagConstraints();
	c.ipady = 10;
	c.ipadx = 10;
	c.fill = GridBagConstraints.BOTH;

	c.gridx = 0;
	c.gridy = 5;
	c.weighty = 0.5;
	content.add(measuresPanel, c);
	c.gridx = 1;
	c.gridy = 5;
	c.weightx = 1.0;
	c.weighty = 0.5;
	content.add(plotPanel, c);

	c.gridx = 0;
	c.gridy = 20;
	c.gridwidth = 2;
	c.weighty = 0.0;
	c.fill = GridBagConstraints.HORIZONTAL;
	c.anchor = GridBagConstraints.PAGE_END;
	content.add(new JLabel(" \u00A9 JReliability.org 2008-2017"), c);

	frame.pack();
	frame.setVisible(true);
}
 
Example 19
Project: JavaMinicap   File: MainFrame.java   View Source Code Vote up 4 votes
public void init(){
		JFrame.setDefaultLookAndFeelDecorated(true);
		f = new JFrame();
		f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		f.setPreferredSize(new Dimension(FRAME_WIDTH, FRAME_HEIGHT));
		f.setTitle("群控");       
		f.setResizable(true);   
		f.setLocationRelativeTo(null);
		
		jpControl = new JPanel();
		jbSendZone = new JButton("发送朋友圈");
		jpControl.add(jbSendZone);
		
		jpDevice = new JPanel();
//		jpDevice.setLayout(new FlowLayout(FlowLayout.LEADING, 20, 5));
		jpDevice.setLayout(new WrapLayout(WrapLayout.LEFT));
		Iterator<Entry<String, Thread>> iter = Devices.devices.entrySet().iterator();
		int port = 1313, count=0;
		while(iter.hasNext()){
			Map.Entry<String, Thread> entry = (Map.Entry<String, Thread>)iter.next();
			String serial = entry.getKey();
			JPanel jp = new JPanel();
			DrawImageThread dit = new DrawImageThread(serial, port++, jp);
			dit.start();			//启动绘制线程
			entry.setValue(dit);	//在device list中保存线程句柄
			
			count++;
			jpDevice.add(jp);
		}
		jspDevice = new JScrollPane(jpDevice);
		jspDevice.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
	
		jsp = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, jpControl, jspDevice);
		jsp.setDividerLocation(0.3);
		jsp.setDividerSize(10);
		jsp.setOneTouchExpandable(true);
		f.add(jsp);
		
		f.pack();
		f.setVisible(true);
	}
 
Example 20
Project: Kaeon-FUSION   File: IDE.java   View Source Code Vote up 3 votes
public void initializeFrame() {

		initializeLookAndFeel();

		font = new Font("None", Font.BOLD, scale(14));

		frame = new JFrame();

		frame.setLayout(new BorderLayout());

		JPanel inputPanel = new JPanel();
		initializeInputPanel(inputPanel);

		frame.add(inputPanel, BorderLayout.WEST);

		JPanel workPanel = new JPanel();

		initializeWorkPanel(workPanel);

		frame.add(workPanel, BorderLayout.CENTER);

		JPanel outputPanel = new JPanel();
		initializeOutputPanel(outputPanel);

		frame.add(outputPanel, BorderLayout.EAST);

		frame.setTitle("Kaeon Origin");
		frame.setSize(scale(800), scale(500));
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setVisible(true);
	}