當前位置: 首頁>>代碼示例>>Java>>正文


Java TitledBorder.LEFT屬性代碼示例

本文整理匯總了Java中javax.swing.border.TitledBorder.LEFT屬性的典型用法代碼示例。如果您正苦於以下問題:Java TitledBorder.LEFT屬性的具體用法?Java TitledBorder.LEFT怎麽用?Java TitledBorder.LEFT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在javax.swing.border.TitledBorder的用法示例。


在下文中一共展示了TitledBorder.LEFT屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: JustificationPropertyEditor

public JustificationPropertyEditor() {
    super(
        new int[] {
            TitledBorder.DEFAULT_JUSTIFICATION,
            TitledBorder.LEFT,
            TitledBorder.CENTER,
            TitledBorder.RIGHT,
            TitledBorder.LEADING,
            TitledBorder.TRAILING,
        },
        new String[] {
            "javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION", // NOI18N
            "javax.swing.border.TitledBorder.LEFT", // NOI18N
            "javax.swing.border.TitledBorder.CENTER", // NOI18N
            "javax.swing.border.TitledBorder.RIGHT", // NOI18N
            "javax.swing.border.TitledBorder.LEADING", // NOI18N
            "javax.swing.border.TitledBorder.TRAILING", // NOI18N
        },
        new String[] {
            "VALUE_JustDefault", // NOI18N
            "VALUE_JustLeft", // NOI18N
            "VALUE_JustCenter", // NOI18N
            "VALUE_JustRight", // NOI18N
            "VALUE_JustLeading", // NOI18N
            "VALUE_JustTrailing", // NOI18N
        }
    );
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:28,代碼來源:TitledBorderBeanInfo.java

示例2: MyPanel

public MyPanel(){
	// Title area
	treeFrame = createVerticalPanel(false);
	add(treeFrame);
	titledborder = new TitledBorder(null, "title", TitledBorder.LEFT, TitledBorder.TOP);
	treeFrame.setBorder(new CompoundBorder(titledborder, border5));
	setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
	treeFrame.setVisible(false);
}
 
開發者ID:HML-UnBBayes,項目名稱:hml,代碼行數:9,代碼來源:MyPanel.java

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

示例4: 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.LEFT屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。