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


Java JFrame.setResizable方法代码示例

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


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

示例1: initialize

import javax.swing.JFrame; //导入方法依赖的package包/类
/**
 * 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);
}
 
开发者ID:mguaylambert,项目名称:JavaClass,代码行数:25,代码来源:InterfaceSéparateur.java

示例2: DBDump

import javax.swing.JFrame; //导入方法依赖的package包/类
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);
}
 
开发者ID:dev-cuttlefish,项目名称:cuttlefish,代码行数:27,代码来源:DBDump.java

示例3: AView

import javax.swing.JFrame; //导入方法依赖的package包/类
/**
 * 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);

}
 
开发者ID:Ativelox,项目名称:Rummy,代码行数:38,代码来源:AView.java

示例4: 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

示例5: initialize

import javax.swing.JFrame; //导入方法依赖的package包/类
/**
 * 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);
}
 
开发者ID:hisener,项目名称:bbm487s2017g1,代码行数:34,代码来源:CustomerMyBooksAndReservationsWindow.java

示例6: main

import javax.swing.JFrame; //导入方法依赖的package包/类
/**
 * 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);
}
 
开发者ID:GateNLP,项目名称:gate-core,代码行数:19,代码来源:SingleConcatenatedFileInputDialog.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: 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

示例9: initialize

import javax.swing.JFrame; //导入方法依赖的package包/类
/**
 * 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);
}
 
开发者ID:mguaylambert,项目名称:JavaClass,代码行数:35,代码来源:InterfaceLongeurTotale.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: ViewDemo

import javax.swing.JFrame; //导入方法依赖的package包/类
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);
}
 
开发者ID:followwwind,项目名称:javase,代码行数:15,代码来源:ViewDemo.java

示例12: initialize

import javax.swing.JFrame; //导入方法依赖的package包/类
/**
 * 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);
}
 
开发者ID:mguaylambert,项目名称:JavaClass,代码行数:32,代码来源:Interface.java

示例13: 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);
    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();
}
 
开发者ID:iapafoto,项目名称:DicomViewer,代码行数:13,代码来源:DicomViewerTexture3D.java

示例14: main

import javax.swing.JFrame; //导入方法依赖的package包/类
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();
			}
		}
	});		
	
}
 
开发者ID:brandonbai,项目名称:game2048_tetris,代码行数:38,代码来源:Main.java

示例15: ImShow

import javax.swing.JFrame; //导入方法依赖的package包/类
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);
}
 
开发者ID:IsaacChanghau,项目名称:OptimizedImageEnhance,代码行数:13,代码来源:ImShow.java


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