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

The following are Jave code examples for showing how to use setResizable() 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: JavaClass   File: InterfaceSéparateur.java   View Source Code Vote up 6 votes
/**
 * Initialize the contents of the frame.
 */
private void initialize() {
	textFieldInput.setBounds(169, 15, 245, 26);
	textFieldInput.setColumns(10);
	frame = new JFrame();
	frame.setResizable(false);
	frame.setBounds(100, 100, 450, 195);
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frame.getContentPane().setLayout(null);
	lblTapezVotreChaine.setBounds(18, 20, 150, 16);
	
	frame.getContentPane().add(lblTapezVotreChaine);
	
	frame.getContentPane().add(textFieldInput);
	btnSeparation.addActionListener(new BtnSeparationActionListener());
	btnSeparation.setBounds(116, 68, 210, 29);
	
	frame.getContentPane().add(btnSeparation);
	lblOutput.setBounds(18, 131, 396, 16);
	
	frame.getContentPane().add(lblOutput);
}
 
Example 2
Project: cuttlefish   File: DBDump.java   View Source Code Vote up 6 votes
public DBDump(NetworkPanel networkPanel) {		
	this.networkPanel = networkPanel;
	
	dbTypeToDriverName = new HashMap<String, String>();		
	dbTypeToDriverName.put("MySQL", "com.mysql.jdbc.Driver");
	dbTypeToDriverName.put("PostgreSQL", "org.postgresql.Driver");
	dbTypeToDriverName.put("SQLite", "org.sqlite.JDBC");
	dbTypeToURL = new HashMap<String, String>();
	dbTypeToURL.put("MySQL", "jdbc:mysql://");
	dbTypeToURL.put("PostgreSQL", "jdbc:postgresql://");
	dbTypeToURL.put("SQLite", "jdbc:sqlite::/");
	
	frame = new JFrame();
	initComponents();
	
	selectAttrs = new JFrame();
	initAttrComponents();
	
	selectAttrs.setSize(410,447);
	selectAttrs.setResizable(false);
	selectAttrs.setVisible(false);
	
	frame.setSize(430, 370);
	frame.setResizable(false);		
	frame.setVisible(true);
}
 
Example 3
Project: Rummy   File: AView.java   View Source Code Vote up 6 votes
/**
 * Initiates a new View instance.
 * 
 * @param title
 *            The title displayed on the frame.
 * @param width
 *            The width of the frame.
 * @param height
 *            The height of the frame.
 * @param manager
 *            The RenderManager of this View, managing render layers.
 */
public AView(String mTitle, int mWidth, int mHeight, RenderManager mManager) {
	super(0, 0, mWidth, mHeight);

	manager = mManager;
	title = mTitle;
	height = mHeight;
	width = mWidth;

	frame = new JFrame(title);
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frame.setResizable(false);
	frame.setSize(width, height);
	frame.setLocationRelativeTo(null);
	frame.setVisible(false);

	canvas = new Canvas();
	canvas.setPreferredSize(new Dimension(width, height));
	canvas.setMaximumSize(new Dimension(width, height));
	canvas.setMinimumSize(new Dimension(width, height));
	canvas.setFocusable(false);
	canvas.setBounds(0, 0, width, height);

	frame.add(canvas);

}
 
Example 4
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 5
Project: cuttlefish   File: DBDump.java   View Source Code Vote up 6 votes
public DBDump(NetworkPanel networkPanel) {		
	this.networkPanel = networkPanel;
	
	dbTypeToDriverName = new HashMap<String, String>();		
	dbTypeToDriverName.put("MySQL", "com.mysql.jdbc.Driver");
	dbTypeToDriverName.put("PostgreSQL", "org.postgresql.Driver");
	dbTypeToDriverName.put("SQLite", "org.sqlite.JDBC");
	dbTypeToURL = new HashMap<String, String>();
	dbTypeToURL.put("MySQL", "jdbc:mysql://");
	dbTypeToURL.put("PostgreSQL", "jdbc:postgresql://");
	dbTypeToURL.put("SQLite", "jdbc:sqlite::/");
	
	frame = new JFrame();
	initComponents();
	
	selectAttrs = new JFrame();
	initAttrComponents();
	
	selectAttrs.setSize(410,447);
	selectAttrs.setResizable(false);
	selectAttrs.setVisible(false);
	
	frame.setSize(430, 370);
	frame.setResizable(false);		
	frame.setVisible(true);
}
 
Example 6
Project: gate-core   File: SingleConcatenatedFileInputDialog.java   View Source Code Vote up 6 votes
/**
 * Test code
 */
static public void main(String[] args) {
  try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    Gate.init();
  }
  catch(Exception e) {
    e.printStackTrace();
  }
  JFrame frame = new JFrame("Foo");
  SingleConcatenatedFileInputDialog comp = new SingleConcatenatedFileInputDialog();
  frame.getContentPane().add(comp);
  frame.pack();
  frame.setResizable(false);
  frame.setVisible(true);
}
 
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: 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 9
Project: JavaClass   File: InterfaceLongeurTotale.java   View Source Code Vote up 5 votes
/**
 * Initialize the contents of the frame.
 */
private void initialize() {
	txtPrnom.setBounds(100, 70, 130, 26);
	txtPrnom.setColumns(10);
	txtNom.setBounds(100, 29, 130, 26);
	txtNom.setColumns(10);
	frame = new JFrame();
	frame.setResizable(false);
	frame.setBounds(100, 100, 450, 201);
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frame.getContentPane().setLayout(null);
	lblNom.setBounds(35, 34, 61, 16);
	
	frame.getContentPane().add(lblNom);
	lblPrnom.setBounds(35, 75, 61, 16);
	
	frame.getContentPane().add(lblPrnom);
	
	frame.getContentPane().add(txtNom);
	
	frame.getContentPane().add(txtPrnom);
	btnCompter.addActionListener(new BtnCompterActionListener());
	btnCompter.setBounds(287, 48, 117, 29);
	
	frame.getContentPane().add(btnCompter);
	lblNombreDeCaractres.setBounds(35, 136, 151, 16);
	
	frame.getContentPane().add(lblNombreDeCaractres);
	lblNbcarac.setBounds(189, 136, 61, 16);
	
	frame.getContentPane().add(lblNbcarac);
}
 
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: javase   File: ViewDemo.java   View Source Code Vote up 5 votes
public ViewDemo() {
	// TODO Auto-generated constructor stub
	frame = new JFrame();
	setPosition();
	Dimension faceSize = new Dimension(600, 600);
	// 设置窗口的位置
	Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
	frame.setSize(faceSize);
	frame.setLocation((int) (screenSize.width - faceSize.getWidth()) / 2,
			(int) (screenSize.height - faceSize.getHeight()) / 2);
	frame.setResizable(false);
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frame.setVisible(true);
}
 
Example 12
Project: JavaClass   File: Interface.java   View Source Code Vote up 5 votes
/**
 * Initialize the contents of the frame.
 */
private void initialize() {
	txtValeurCherche.setBounds(148, 58, 114, 26);
	txtValeurCherche.setColumns(10);
	txtTableau.setBounds(98, 22, 397, 26);
	txtTableau.setColumns(10);
	frame = new JFrame();
	frame.setResizable(false);
	frame.setBounds(100, 100, 530, 211);
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frame.getContentPane().setLayout(null);
	lblTableau.setBounds(29, 27, 57, 16);
	
	frame.getContentPane().add(lblTableau);
	
	frame.getContentPane().add(txtTableau);
	lblValeurCherche.setBounds(29, 63, 107, 16);
	
	frame.getContentPane().add(lblValeurCherche);
	
	frame.getContentPane().add(txtValeurCherche);
	btnRecherche.addActionListener(new BtnRechercheActionListener());
	btnRecherche.setBounds(19, 91, 117, 29);
	
	frame.getContentPane().add(btnRecherche);
	lblPosition.setBounds(29, 148, 466, 16);
	
	frame.getContentPane().add(lblPosition);
}
 
Example 13
Project: DicomViewer   File: DicomViewerTexture3D.java   View Source Code Vote up 5 votes
public static void main(String[] args) throws Exception {
    JFrame frame = new JFrame("OpenCL Editor");
    frame.setResizable(true);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    DicomViewerTexture3D ch = new DicomViewerTexture3D();
    ch.setPreferredSize(new Dimension(800, 600));
    frame.setLayout(new BorderLayout());
    frame.add(ch, BorderLayout.CENTER);
    frame.pack();
    frame.show();
    ch.onLoadProgram();
}
 
Example 14
Project: bbm487s2017g1   File: CustomerMyBooksAndReservationsWindow.java   View Source Code Vote up 5 votes
/**
 * Initialize the contents of the frame.
 */
private void initialize() {
    frame = new JFrame("Library Book Loan System - My Books and Reservations");
    frame.setResizable(false);
    frame.setBounds(100, 100, 700, 400);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().setLayout(null);
    
    JLabel label = new JLabel("Library Book Loan System");
    label.setHorizontalAlignment(SwingConstants.CENTER);
    label.setFont(new Font("Segoe UI Light", Font.PLAIN, 18));
    label.setBounds(10, 11, 674, 30);
    frame.getContentPane().add(label);
    
    JLabel lblBookReservations = new JLabel("My Books and Reservations");
    lblBookReservations.setHorizontalAlignment(SwingConstants.CENTER);
    lblBookReservations.setFont(new Font("Segoe UI Light", Font.PLAIN, 14));
    lblBookReservations.setBounds(10, 42, 674, 22);
    frame.getContentPane().add(lblBookReservations);
        
    JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
    tabbedPane.setBackground(SystemColor.text);
    tabbedPane.setBounds(10, 75, 674, 228);
    frame.getContentPane().add(tabbedPane);
    
    initializeCurrentBooks(tabbedPane);
    initializeWaitlist(tabbedPane);
    initializeHistory(tabbedPane);
    
    frame.setVisible(true);
}
 
Example 15
Project: game2048_tetris   File: Main.java   View Source Code Vote up 5 votes
public static void main(String[] args) {
	//新建窗体对象
	frame = new JFrame("2048");
	frame.setIconImage(new ImageIcon(MainPanel.class.getResource("gameicon.png")).getImage());
	//窗体大小
	frame.setSize(460, 680);
	//窗体居中
	frame.setLocationRelativeTo(null);
	//窗体大小不可变
	frame.setResizable(false);
	//默认的关闭操作
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	//新建主面板 对象
	mainPanel = new MainPanel(frame);
	//去掉面板默认布局
	mainPanel.setLayout(new FlowLayout(1, 200, 90));
	//面板背景颜色
	mainPanel.setBackground(new Color(247, 239, 230));
	//把面板添加到窗体中
	frame.add(mainPanel);
	//窗体可见
	frame.setVisible(true);
	//主界面的控制方法
	mainPanel.run();
	frame.addWindowListener(new WindowAdapter() {
		public void windowClosing(WindowEvent e) {
			try {
				mainPanel.getClassicPanel().saveScore();
				mainPanel.getClassicPanel().saveState();
				mainPanel.getDropPanel().updateTopScore();
			} catch (IOException e1) {
				e1.printStackTrace();
			}
		}
	});		
	
}
 
Example 16
Project: OptimizedImageEnhance   File: ImShow.java   View Source Code Vote up 5 votes
public ImShow(String title) {
	Window = new JFrame();
	image = new ImageIcon();
	label = new JLabel();
	// matOfByte = new MatOfByte();
	label.setIcon(image);
	Window.getContentPane().add(label);
	Window.setResizable(false);
	Window.setTitle(title);
	SizeCustom = false;
	setCloseOption(0);
}
 
Example 17
Project: OptimizedImageEnhance   File: ImShow.java   View Source Code Vote up 5 votes
public ImShow(String title, int height, int width) {
	SizeCustom = true;
	Height = height;
	Width = width;
	Window = new JFrame();
	image = new ImageIcon();
	label = new JLabel();
	// matOfByte = new MatOfByte();
	label.setIcon(image);
	Window.getContentPane().add(label);
	Window.setResizable(false);
	Window.setTitle(title);
	setCloseOption(0);

}
 
Example 18
Project: JavaClass   File: InterfaceGraphique.java   View Source Code Vote up 5 votes
/**
 * Initialize the contents of the frame.
 */
private void initialize() {
	txtPhrase.setBounds(30, 44, 393, 26);
	txtPhrase.setColumns(10);
	frame = new JFrame();
	frame.setResizable(false);
	frame.setBounds(100, 100, 450, 300);
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frame.getContentPane().setLayout(null);
	lblMichalGuaylambert.setBounds(151, 16, 148, 16);
	
	frame.getContentPane().add(lblMichalGuaylambert);
	
	frame.getContentPane().add(txtPhrase);
	btnAfficher.addActionListener(new BtnAfficherActionListener());
	btnAfficher.setBounds(168, 82, 117, 29);
	
	frame.getContentPane().add(btnAfficher);
	Pair.setBounds(30, 123, 393, 16);
	
	frame.getContentPane().add(Pair);
	Impair.setBounds(30, 165, 393, 16);
	
	frame.getContentPane().add(Impair);
	lblMajuscule.setBounds(30, 206, 393, 16);
	
	frame.getContentPane().add(lblMajuscule);
}
 
Example 19
Project: JavaClass   File: Résultats.java   View Source Code Vote up 5 votes
/**
 * Initialize the contents of the frame.
 */
private void initialize() {
	frame = new JFrame();
	frame.setResizable(false);
	frame.setBounds(100, 100, 450, 423);
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frame.getContentPane().setLayout(null);
	lblLieuQuartier.setBounds(159, 29, 156, 16);
	
	frame.getContentPane().add(lblLieuQuartier);
	lblLieulength.setBounds(37, 95, 371, 16);
	
	frame.getContentPane().add(lblLieulength);
	lblLieusubstring.setBounds(37, 122, 371, 16);
	
	frame.getContentPane().add(lblLieusubstring);
	lblLieucharat.setBounds(37, 150, 371, 16);
	
	frame.getContentPane().add(lblLieucharat);
	lblLieuindexofhun.setBounds(37, 178, 371, 16);
	
	frame.getContentPane().add(lblLieuindexofhun);
	lblLieuindexofv.setBounds(37, 206, 371, 16);
	
	frame.getContentPane().add(lblLieuindexofv);
	lblLieusubstringtouppercase.setBounds(37, 234, 371, 16);
	
	frame.getContentPane().add(lblLieusubstringtouppercase);
	btnAfficherLaSolution.addActionListener(new BtnAfficherLaSolutionActionListener());
	btnAfficherLaSolution.setBounds(146, 323, 165, 29);
	
	frame.getContentPane().add(btnAfficherLaSolution);
	btnRinitialiser.addActionListener(new BtnRinitialiserActionListener());
	btnRinitialiser.setBounds(170, 352, 117, 29);
	
	frame.getContentPane().add(btnRinitialiser);
}
 
Example 20
Project: GroupControlDroidClient   File: Entrance.java   View Source Code Vote up 4 votes
/**
 * 点击测试连接按钮
 * 
 * @param evt
 */
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
	// TODO add your handling code here:
	JFrame frame = new JFrame("设备连接测试");
	LayoutManager layout = new GridLayout(2, 2);
	frame.setLayout(layout);
	frame.setBounds(20, 20, 300, 100);
	frame.setVisible(true);
	frame.setResizable(false);
	frame.setLocationRelativeTo(null);

	TextField textFiled1 = new TextField("可用设备数");
	textFiled1.setEditable(false);
	connectedCountDeviceTextField.setEditable(false);
	frame.getContentPane().add(textFiled1);
	frame.getContentPane().add(connectedCountDeviceTextField);

	TextField textFiled2 = new TextField("总设备数");
	textFiled2.setEditable(false);
	totalCountDeviceTextField.setEnabled(false);
	frame.getContentPane().add(textFiled2);
	frame.getContentPane().add(totalCountDeviceTextField);

	// 设备数监听
	Thread countDeviceThread = new Thread(new Runnable() {
		@Override
		public void run() {
			int connected = 0, total = 0;// 已在线设备数,总设备数
			AndroidDebugBridge bridge = AdbUtil.getADBInstance();
			if (bridge != null) {
				try {
					while (!Thread.currentThread().isInterrupted()) {
						IDevice[] devices = bridge.getDevices();
						if (devices != null) {
							total = devices.length;
							connected = 0;
							for (IDevice device : devices) {
								if (device != null && device.isOnline()) {
									connected++;
								}
							}
						}
						connectedCountDeviceTextField.setText(String.format("%d", connected));
						totalCountDeviceTextField.setText(String.format("%d", total));

						Thread.sleep(500);

					}
				} catch (InterruptedException e) {
					logger.info("设备数目监听线程退出");
				}
			}
		}
	}, "CountDeviceThread");
	countDeviceThread.start();

	/* 窗口退出,退出线程 */
	frame.addWindowListener(new WindowAdapter() {
		public void windowClosing(WindowEvent we) {
			countDeviceThread.interrupt();
		}
	});
}