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


Java TitledBorder.DEFAULT_POSITION属性代码示例

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


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

示例1: PositionPropertyEditor

public PositionPropertyEditor() {
    super(
        new int[] {
            TitledBorder.DEFAULT_POSITION,
            TitledBorder.ABOVE_TOP,
            TitledBorder.TOP,
            TitledBorder.BELOW_TOP,
            TitledBorder.ABOVE_BOTTOM,
            TitledBorder.BOTTOM,
            TitledBorder.BELOW_BOTTOM
        },
        new String[] {
            "javax.swing.border.TitledBorder.DEFAULT_POSITION", // NOI18N
            "javax.swing.border.TitledBorder.ABOVE_TOP", // NOI18N
            "javax.swing.border.TitledBorder.TOP", // NOI18N
            "javax.swing.border.TitledBorder.BELOW_TOP", // NOI18N
            "javax.swing.border.TitledBorder.ABOVE_BOTTOM", // NOI18N
            "javax.swing.border.TitledBorder.BOTTOM", // NOI18N
            "javax.swing.border.TitledBorder.BELOW_BOTTOM" // NOI18N
        },
        new String[] {
            "VALUE_PosDefault", // NOI18N
            "VALUE_PosAboveTop", // NOI18N
            "VALUE_PosTop", // NOI18N
            "VALUE_PosBelowTop", // NOI18N
            "VALUE_PosAboveBottom", // NOI18N
            "VALUE_PosBottom", // NOI18N
            "VALUE_PosBelowBottom", // NOI18N
        }
    );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:31,代码来源:TitledBorderBeanInfo.java

示例2: createHotCorners

private JPanel createHotCorners() {
	// main body
	JPanel main = new JPanel();
	main.setBorder(new EmptyBorder(10, 0, 0, 0));
	main.setLayout(new BoxLayout(main, BoxLayout.Y_AXIS));

	// Create and populate the panel.
	JPanel generalSettingsPanel = new JPanel(new SpringLayout());

	MatteBorder mb = new MatteBorder(1, 0, 0, 0, Color.LIGHT_GRAY);
	TitledBorder tb = new TitledBorder(mb, I18n.get("settings.hotcornertitle"), TitledBorder.LEFT,
			TitledBorder.DEFAULT_POSITION);
	generalSettingsPanel.setBorder(tb);

	JLabel cornerLabel = new JLabel(I18n.get("settings.hotcorner"), JLabel.TRAILING);
	generalSettingsPanel.add(cornerLabel);
	hotCornerBox = new JComboBox<>();
	cornerLabel.setLabelFor(hotCornerBox);
	generalSettingsPanel.add(hotCornerBox);
	DefaultComboBoxModel<ScreenPosition> cornerBoxModel = new DefaultComboBoxModel<ScreenPosition>(
			(ScreenPosition[]) Util.getScreenPositions());
	hotCornerBox.setModel(cornerBoxModel);

	JLabel userLabel = new JLabel(I18n.get("settings.hotcornerscreen"), JLabel.TRAILING);
	generalSettingsPanel.add(userLabel);
	screenBox = new JComboBox<>();

	DefaultComboBoxModel<ScreenModel> screenBoxModel = new DefaultComboBoxModel<ScreenModel>(
			(ScreenModel[]) Util.getScreens());
	screenBox.setModel(screenBoxModel);
	generalSettingsPanel.add(screenBox);
	

	JLabel darkIconLabel = new JLabel(I18n.get("settings.darkicon"), JLabel.TRAILING);
	generalSettingsPanel.add(darkIconLabel);
	darkIconInput = new JCheckBox();
	darkIconInput.setSelected(false);
	darkIconLabel.setLabelFor(darkIconInput);
	generalSettingsPanel.add(darkIconInput);

	

	// Lay out the panel.
	SwingUtil.makeCompactGrid(generalSettingsPanel, 3, 2, // rows, cols
			6, 6, // initX, initY
			6, 6); // xPad, yPad

	main.add(generalSettingsPanel);
	return main;
}
 
开发者ID:michaelnetter,项目名称:dracoon-dropzone,代码行数:50,代码来源:SettingsDialog.java

示例3: createCredentialsInput

private JPanel createCredentialsInput() {
	// main body
	JPanel main = new JPanel();
	main.setBorder(new EmptyBorder(10, 0, 10, 0));
	main.setLayout(new BoxLayout(main, BoxLayout.Y_AXIS));

	// Create and populate the panel.
	JPanel credentialsPanel = new JPanel(new SpringLayout());

	MatteBorder mb = new MatteBorder(1, 0, 0, 0, Color.LIGHT_GRAY);
	TitledBorder tb = new TitledBorder(mb, I18n.get("settings.credentials"), TitledBorder.LEFT,
			TitledBorder.DEFAULT_POSITION);
	credentialsPanel.setBorder(tb);

	JLabel serverLabel = new JLabel(I18n.get("settings.server"), JLabel.TRAILING);
	credentialsPanel.add(serverLabel);
	serverInput = new JTextField();
	serverLabel.setLabelFor(serverInput);
	credentialsPanel.add(serverInput);

	JLabel authLabel = new JLabel(I18n.get("settings.authmethod"), JLabel.TRAILING);
	credentialsPanel.add(authLabel);
	authBox = new JComboBox<>();
	authLabel.setLabelFor(authBox);
	credentialsPanel.add(authBox);

	JLabel pathLabel = new JLabel(I18n.get("settings.remotepath"), JLabel.TRAILING);
	credentialsPanel.add(pathLabel);
	pathInput = new JTextField();
	pathLabel.setLabelFor(pathInput);
	credentialsPanel.add(pathInput);

	JLabel userLabel = new JLabel(I18n.get("settings.username"), JLabel.TRAILING);
	credentialsPanel.add(userLabel);
	userInput = new JTextField();
	userLabel.setLabelFor(userInput);
	credentialsPanel.add(userInput);

	JLabel pwdLabel = new JLabel(I18n.get("settings.password"), JLabel.TRAILING);
	credentialsPanel.add(pwdLabel);
	pwdInput = new JPasswordField();
	pwdLabel.setLabelFor(pwdInput);
	credentialsPanel.add(pwdInput);

	JLabel enableMasterPwdLabel = new JLabel(I18n.get("settings.usemasterpwd"), JLabel.TRAILING);
	credentialsPanel.add(enableMasterPwdLabel);
	useMasterPasswordInput = new JCheckBox();
	useMasterPasswordInput.setSelected(false);
	useMasterPasswordInput.setToolTipText(I18n.get("settings.masterpwddesc"));
	enableMasterPwdLabel.setLabelFor(useMasterPasswordInput);
	credentialsPanel.add(useMasterPasswordInput);
	useMasterPasswordInput.addActionListener(new ActionListener() {
		@Override
		public void actionPerformed(ActionEvent e) {
			setMasterPwdInputEnabled(useMasterPasswordInput.isSelected());
		}
	});

	masterPwdLabel = new JLabel(I18n.get("settings.masterpwd"), JLabel.TRAILING);
	masterPwdLabel.setEnabled(false);
	credentialsPanel.add(masterPwdLabel);
	masterPwdInput = new JPasswordField();
	masterPwdInput.setToolTipText(I18n.get("settings.masterpwddesc"));
	masterPwdInput.setEnabled(false);
	masterPwdLabel.setLabelFor(masterPwdInput);
	credentialsPanel.add(masterPwdInput);

	// Lay out the panel.
	SwingUtil.makeCompactGrid(credentialsPanel, 7, 2, // rows, cols
			6, 6, // initX, initY
			6, 6); // xPad, yPad

	main.add(credentialsPanel);
	return main;
}
 
开发者ID:michaelnetter,项目名称:dracoon-dropzone,代码行数:75,代码来源:SettingsDialog.java


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