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


Java JSeparator.setBounds方法代码示例

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


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

示例1: addSeparator

import javax.swing.JSeparator; //导入方法依赖的package包/类
public void addSeparator() {
    if (!UIUtils.isMetalLookAndFeel()) {
        super.addSeparator();
    } else {
        final JSeparator separator = new JSeparator(JSeparator.VERTICAL);
        final int WDTH = separator.getPreferredSize().width;
        final Dimension SIZE = new Dimension(new JToolBar.Separator().getSeparatorSize().width, 12);
        JPanel panel = new JPanel(null) {
            public Dimension getPreferredSize() { return SIZE; }
            public Dimension getMaximumSize() { return SIZE; }
            public Dimension getMinimumSize() { return SIZE; }

            public void doLayout() {
                int x = (getWidth() - WDTH) / 2;
                int y = (getHeight()- SIZE.height) / 2;
                separator.setBounds(x, y, WDTH, SIZE.height);
            }
        };
        panel.setOpaque(false);
        panel.add(separator);
        super.add(panel);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:GenericToolbar.java

示例2: initialize

import javax.swing.JSeparator; //导入方法依赖的package包/类
/**
* Método responsável por inicializar componentes da tela
*
* @throws ParseException
*/
private void initialize() throws ParseException {

	setModal(true);
	this.setLocationRelativeTo(null);

	setTitle("Abertura de Conta");
	setBounds(100, 100, 300, 250);
	getContentPane().setLayout(null);

	JLabel lblNumero = new JLabel("Numero *:");
	lblNumero.setBounds(10, 39, 80, 14);
	getContentPane().add(lblNumero);

	JLabel lblDataDeAbertura = new JLabel("Abertura:");
	lblDataDeAbertura.setBounds(10, 11, 80, 14);
	getContentPane().add(lblDataDeAbertura);

	JLabel lblSaldoInicial = new JLabel("Saldo Inicial:");
	lblSaldoInicial.setBounds(10, 67, 80, 14);
	getContentPane().add(lblSaldoInicial);
	
	btnCancelar = new JButton("Cancelar");
	btnCancelar.setBounds(175, 166, 99, 35);
	getContentPane().add(btnCancelar);

	btnSalvar = new JButton("Salvar");
	btnSalvar.setBounds(55, 166, 99, 35);
	getContentPane().add(btnSalvar);

	JSeparator separator = new JSeparator();
	separator.setBounds(10, 153, 264, 2);
	getContentPane().add(separator);

	tfNumero = new JTextField();
	tfNumero.setBounds(110, 36, 75, 20);
	getContentPane().add(tfNumero);

	tfSaldo = new JTextField();
	tfSaldo.setBounds(110, 64, 75, 20);
	getContentPane().add(tfSaldo);
	tfSaldo.setColumns(10);

	lblCamposObrigatrios = new JLabel("(*) Campos Obrigatórios");
	lblCamposObrigatrios.setHorizontalAlignment(SwingConstants.RIGHT);
	lblCamposObrigatrios.setFont(new Font("Tahoma", Font.PLAIN, 11));
	lblCamposObrigatrios.setBounds(138, 120, 136, 24);
	getContentPane().add(lblCamposObrigatrios);

	
	txDtAbertura = new JTextField();
	txDtAbertura.setBounds(110, 9, 170, 19);
	txDtAbertura.setEnabled(false);
	Date date = new Date();
	txDtAbertura.setText(UtilData.formataData(date));
	getContentPane().add(txDtAbertura);
	txDtAbertura.setColumns(10);
}
 
开发者ID:alexferreiradev,项目名称:3way_laboratorios,代码行数:63,代码来源:DialogAbrirConta.java

示例3: initialize

import javax.swing.JSeparator; //导入方法依赖的package包/类
/**
* Método responsável por inicializar todos os componentes swing deste frame
*
*/
private void initialize() {				
	frmGereciamentoDeBanco = new JFrame();
	frmGereciamentoDeBanco.setResizable(false);
	frmGereciamentoDeBanco.setTitle("Sistema de Gereciamento de Banco");
	frmGereciamentoDeBanco.setBounds(100, 100, 800, 600);
	frmGereciamentoDeBanco.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frmGereciamentoDeBanco.getContentPane().setLayout(null);
	frmGereciamentoDeBanco.setLocationRelativeTo(null);

	JLabel lblBanco = new JLabel("Banco:");
	lblBanco.setFont(new Font("Tahoma", Font.BOLD, 14));
	lblBanco.setBounds(10, 11, 74, 23);
	frmGereciamentoDeBanco.getContentPane().add(lblBanco);

	JLabel lblAgencia = new JLabel("Agência:");
	lblAgencia.setFont(new Font("Tahoma", Font.BOLD, 14));
	lblAgencia.setBounds(10, 45, 74, 23);
	frmGereciamentoDeBanco.getContentPane().add(lblAgencia);

	btnManterClientes = new JButton("Manter Clientes");
	btnManterClientes.setBounds(10, 89, 170, 37);
	frmGereciamentoDeBanco.getContentPane().add(btnManterClientes);

	btnOperaesBancarias = new JButton("Operações Bancarias");
	btnOperaesBancarias.setBounds(190, 89, 170, 37);
	btnOperaesBancarias.setEnabled(Boolean.FALSE);
	frmGereciamentoDeBanco.getContentPane().add(btnOperaesBancarias);

	lblBancoResult = new JLabel("...");
	lblBancoResult.setFont(new Font("Tahoma", Font.BOLD, 14));
	lblBancoResult.setBounds(94, 11, 480, 20);
	frmGereciamentoDeBanco.getContentPane().add(lblBancoResult);

	lblAgenciaResult = new JLabel("...");
	lblAgenciaResult.setFont(new Font("Tahoma", Font.BOLD, 14));
	lblAgenciaResult.setBounds(94, 45, 480, 20);
	frmGereciamentoDeBanco.getContentPane().add(lblAgenciaResult);

	JSeparator separator = new JSeparator();
	separator.setBounds(10, 79, 764, 11);
	frmGereciamentoDeBanco.getContentPane().add(separator);

	panelInterno = new JDesktopPane();
	panelInterno.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));
	panelInterno.setBounds(10, 137, 764, 414);
	frmGereciamentoDeBanco.getContentPane().add(panelInterno);
	panelInterno.setLayout(null);

	frameInterno = new JInternalFrame("New JInternalFrame");
	frameInterno.setBounds(10, 11, 744, 392);
	panelInterno.add(frameInterno);
	frameInterno.setVisible(false);

}
 
开发者ID:alexferreiradev,项目名称:3way_laboratorios,代码行数:59,代码来源:Inicial.java


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