本文整理匯總了Java中javax.swing.border.TitledBorder類的典型用法代碼示例。如果您正苦於以下問題:Java TitledBorder類的具體用法?Java TitledBorder怎麽用?Java TitledBorder使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
TitledBorder類屬於javax.swing.border包,在下文中一共展示了TitledBorder類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createAndShowGUI
import javax.swing.border.TitledBorder; //導入依賴的package包/類
private static void createAndShowGUI() {
try {
UIManager.setLookAndFeel(new TestLookAndFeel());
JLabel label = new JLabel("Test Label");
label.setSize(SIZE, SIZE);
TitledBorder border = new TitledBorder("ABCDEF");
label.setBorder(new TitledBorder(border));
if (useLAF) {
UIManager.setLookAndFeel(new NimbusLookAndFeel());
} else {
UIManager.getDefaults().put("LabelUI", MetalLabelUI.class.getName());
}
SwingUtilities.updateComponentTreeUI(label);
paintToImage(label);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
示例2: CollisionBoxPanel
import javax.swing.border.TitledBorder; //導入依賴的package包/類
public CollisionBoxPanel() {
TitledBorder border = new TitledBorder(new LineBorder(new Color(128, 128, 128)), Resources.get("panel_collisionBox"), TitledBorder.LEADING, TitledBorder.TOP, null, null);
border.setTitleFont(border.getTitleFont().deriveFont(Font.BOLD));
setBorder(border);
chckbxIsObstacle = new JCheckBox(Resources.get("panel_isObstacle"));
GroupLayout groupLayout = new GroupLayout(this);
groupLayout.setHorizontalGroup(
groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup()
.addContainerGap()
.addComponent(chckbxIsObstacle, GroupLayout.PREFERRED_SIZE, 108, GroupLayout.PREFERRED_SIZE)
.addContainerGap(322, Short.MAX_VALUE)));
groupLayout.setVerticalGroup(
groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup()
.addComponent(chckbxIsObstacle, GroupLayout.PREFERRED_SIZE, 21, GroupLayout.PREFERRED_SIZE)
.addContainerGap(258, Short.MAX_VALUE)));
setLayout(groupLayout);
this.setupChangedListeners();
}
示例3: initComponents
import javax.swing.border.TitledBorder; //導入依賴的package包/類
protected void initComponents() {
getContentPane().setLayout(new BorderLayout());
// Fields
envClass = new JTextField(20);
createField("Environment class name", envClass, "Enter the name of the environment Java class here.");
JPanel p = new JPanel(new BorderLayout());
p.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "New environment parameters", TitledBorder.LEFT, TitledBorder.TOP));
p.add(pLabels, BorderLayout.CENTER);
p.add(pFields, BorderLayout.EAST);
getContentPane().add(p, BorderLayout.CENTER);
getContentPane().add(createButtonsPanel(), BorderLayout.SOUTH);
}
示例4: init
import javax.swing.border.TitledBorder; //導入依賴的package包/類
private void init() {
setBorder(new TitledBorder(new LineBorder(new Color(184, 207, 229)), "Relation properties", TitledBorder.LEADING,
TitledBorder.TOP, null, new Color(51, 51, 51)));
WebScrollPane descriptionScrollWrapper = new WebScrollPane(relationDescription);
setLayout(new RiverLayout());
colorChooser.setPipetteEnabled(false);
colorChooser.setFieldType(ColorChooserFieldType.hex);
add(LINE_BREAK + " " + RIGHT, nameLabel);
add(TAB_FILL, relationName);
add(LINE_BREAK, displayLabel);
add(TAB_FILL, relationDisplay);
add(LINE_BREAK, shortcutLabel);
add(TAB_FILL, relationShortcut);
add(LINE_BREAK, descriptionLabel);
add(TAB_FILL, descriptionScrollWrapper);
add(LINE_BREAK, lexiconLabel);
add(TAB_FILL, lexicon);
add(RIGHT, lexiconBtn);
add(LINE_BREAK, multilingualLabel);
add(TAB_FILL, multilingual);
add(LINE_BREAK, posLabel);
add(TAB_FILL, allowedPartsOfSpeech);
add(RIGHT, showAllowedPartsOfSpeechBtn);
add(LINE_BREAK, reverseLabel);
add(TAB_FILL, reverseRelation);
add(RIGHT, reverseRelationBtn);
add(LINE_BREAK, colorLabel);
add(TAB_FILL, colorChooser);
add(LINE_BREAK, directionLabel);
add(TAB_FILL, relationDirection);
add(RiverLayout.LINE_BREAK + " " + RiverLayout.CENTER, btnSave);
}
示例5: connect
import javax.swing.border.TitledBorder; //導入依賴的package包/類
public void connect(PropertyEditor pe, PropertyEnv env) {
if (!tableUI && (env != null) && useTitle) {
setBorder(new TitledBorder(env.getFeatureDescriptor().getDisplayName()));
} else {
setBorder(null);
}
editor = pe;
String[] tags = editor.getTags();
group = new ButtonGroup();
InvRadioButton[] buttons = getButtons(tags.length);
if (env != null) {
setEnabled(env.isEditable());
}
for (int i = 0; i < tags.length; i++) {
InvRadioButton jr = buttons[i];
configureButton(jr, tags[i]);
add(jr);
}
}
示例6: initComponents
import javax.swing.border.TitledBorder; //導入依賴的package包/類
private void initComponents() {
rtPane = new WarningScrollTable(routingTable, WARNING_ROUTING);
noOptLabelPanel.setBorder(new TitledBorder(new EtchedBorder(), "Routing Options"));
noOptLabel.setOpaque(false);
noOptLabel.setEditable(false);
noOptLabel.setLineWrap(true);
noOptLabel.setWrapStyleWord(true);
rtPane.setBorder(new TitledBorder(new EtchedBorder(), "Routing Options"));
descrTextPane.setOpaque(false);
descrTextPane.setEditable(false);
descrTextPane.setLineWrap(true);
descrTextPane.setWrapStyleWord(true);
descrPane.setBorder(new TitledBorder(new EtchedBorder(), "Description"));
descrPane.setViewportView(descrTextPane);
setLeftComponent(descrPane);
}
示例7: enabledCheckBoxActionPerformed
import javax.swing.border.TitledBorder; //導入依賴的package包/類
private void enabledCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_enabledCheckBoxActionPerformed
boolean yes = enabledCheckBox.isSelected();
if (getFilter() != null) {
getFilter().setFilterEnabled(yes);
}
if (yes) {
((TitledBorder) getBorder()).setTitleColor(SystemColor.textText);
titledBorder.setBorder(redLineBorder);
} else {
((TitledBorder) getBorder()).setTitleColor(SystemColor.textInactiveText);
titledBorder.setBorder(normalBorder);
}
repaint();
getFilter().setSelected(yes);
}
示例8: initComponents
import javax.swing.border.TitledBorder; //導入依賴的package包/類
protected void initComponents() {
removeAll();
setLayout(new BorderLayout());
WarningScrollTable wST = new WarningScrollTable(csTable, WARNING_CLASS);
setBorder(new TitledBorder(new EtchedBorder(), "CS Strategies"));
setMinimumSize(new Dimension(180, 100));
descriptionLabel = new JLabel(DESCRIPTION);
normalizzationErrorLabel = new JLabel(NORMALIZATION_ERROR);
normalizzationWarningLabel = new JLabel(NORMALIZATION_WARNING);
checkRowLessThanOne();
add(wST, BorderLayout.CENTER);
add(descriptionLabel, BorderLayout.SOUTH);
JPanel msgPanel = new JPanel(new BorderLayout());
msgPanel.add(normalizzationErrorLabel, BorderLayout.NORTH);
msgPanel.add(normalizzationWarningLabel, BorderLayout.SOUTH);
add(msgPanel, BorderLayout.NORTH);
if (descriptionLabel != null) {
descriptionLabel.setVisible(classData.getClassKeys().size() != 0);
}
}
示例9: initComponents
import javax.swing.border.TitledBorder; //導入依賴的package包/類
protected void initComponents() {
services = RunCentralisedMAS.getRunner().getRuntimeServices();
getContentPane().setLayout(new BorderLayout());
// Fields
Vector<String> agNames = new Vector<String>(services.getAgentsNames());
Collections.sort(agNames);
lAgs = new JList(agNames);
lAgs.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
JPanel p = new JPanel(new BorderLayout());
p.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Current agents", TitledBorder.LEFT, TitledBorder.TOP));
p.add(lAgs, BorderLayout.CENTER);
getContentPane().add(p, BorderLayout.CENTER);
getContentPane().add(createButtonsPanel(), BorderLayout.SOUTH);
ok.setText("Kill");
}
示例10: initComponents
import javax.swing.border.TitledBorder; //導入依賴的package包/類
private void initComponents() {
this.setLayout(new BorderLayout());
//building mainPanel
mainPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
mainPanel.setDividerSize(4);
mainPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
//layout of main panel
WarningScrollTable jsp = new WarningScrollTable(joinStrategies, WARNING_CLASS);
jsp.setBorder(new TitledBorder(new EtchedBorder(), "Join Strategies"));
mainPanel.setResizeWeight(1.0);
jsp.setMinimumSize(new Dimension(200, 100));
mainPanel.setLeftComponent(jsp);
joinEditor.setMinimumSize(new Dimension(225, 100));
mainPanel.setRightComponent(joinEditor);
add(mainPanel, BorderLayout.CENTER);
}
示例11: addMBeanNotificationInfo
import javax.swing.border.TitledBorder; //導入依賴的package包/類
public void addMBeanNotificationInfo(MBeanNotificationInfo mbni) {
emptyInfoTable();
emptyDescTable();
((TitledBorder) infoBorderPanel.getBorder()).setTitle(
Messages.MBEAN_NOTIFICATION_INFO);
String text = Messages.NOTIFICATION + ":";
DefaultTableModel tableModel = (DefaultTableModel) infoTable.getModel();
Object rowData[] = new Object[2];
rowData[0] = new TableRowDivider(text);
rowData[1] = new TableRowDivider("");
tableModel.addRow(rowData);
rowData[0] = Messages.NAME;
rowData[1] = mbni.getName();
tableModel.addRow(rowData);
rowData[0] = Messages.DESCRIPTION;
rowData[1] = mbni.getDescription();
tableModel.addRow(rowData);
rowData[0] = Messages.NOTIF_TYPES;
rowData[1] = Arrays.toString(mbni.getNotifTypes());
tableModel.addRow(rowData);
addDescriptor(mbni.getDescriptor(), text);
tableModel.newDataAvailable(new TableModelEvent(tableModel));
}
示例12: initComponents
import javax.swing.border.TitledBorder; //導入依賴的package包/類
private void initComponents() {
this.setLayout(new BorderLayout());
//building mainPanel
mainPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
mainPanel.setDividerSize(4);
mainPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
//layout of main panel
WarningScrollTable jsp = new WarningScrollTable(semaphoreStrategies, WARNING_CLASS);
jsp.setBorder(new TitledBorder(new EtchedBorder(), "Semaphore Strategies"));
mainPanel.setResizeWeight(1.0);
jsp.setMinimumSize(new Dimension(200, 100));
mainPanel.setLeftComponent(jsp);
semaphoreEditor.setMinimumSize(new Dimension(225, 100));
mainPanel.setRightComponent(semaphoreEditor);
add(mainPanel, BorderLayout.CENTER);
}
示例13: initComponents
import javax.swing.border.TitledBorder; //導入依賴的package包/類
protected void initComponents() {
this.setLayout(new BorderLayout());
//building mainPanel
mainPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
mainPanel.setDividerSize(4);
mainPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
//layout of main panel
WarningScrollTable jsp = new WarningScrollTable(routingStrategies, WARNING_CLASS);
jsp.setBorder(new TitledBorder(new EtchedBorder(), "Routing Strategies"));
mainPanel.setResizeWeight(1.0);
jsp.setMinimumSize(new Dimension(200, 100));
mainPanel.setLeftComponent(jsp);
routingProbEditor.setMinimumSize(new Dimension(225, 100));
mainPanel.setRightComponent(routingProbEditor);
add(mainPanel, BorderLayout.CENTER);
}
示例14: initComponents
import javax.swing.border.TitledBorder; //導入依賴的package包/類
private void initComponents() {
mixPane = new WarningScrollTable(mixTable, WARNING_CLASS);
mixPane.setBorder(new TitledBorder(new EtchedBorder(), "Semaphore Options"));
noOptLabelPanel.setBorder(new TitledBorder(new EtchedBorder(), "Semaphore Options"));
noOptLabel.setOpaque(false);
noOptLabel.setEditable(false);
noOptLabel.setLineWrap(true);
noOptLabel.setWrapStyleWord(true);
descrTextPane.setOpaque(false);
descrTextPane.setEditable(false);
descrTextPane.setLineWrap(true);
descrTextPane.setWrapStyleWord(true);
descrPane.setBorder(new TitledBorder(new EtchedBorder(), "Description"));
descrPane.setViewportView(descrTextPane);
semaphorePane.setLayout(new FlowLayout());
JLabel text = new JLabel("Number of Required Tasks:");
jNumField.setPreferredSize(DIM_BUTTON_XS);
semaphorePane.add(text);
semaphorePane.add(jNumField);
semaphorePane.setBorder(new TitledBorder(new EtchedBorder(), "Semaphore Options"));
setLeftComponent(descrPane);
}
示例15: addInterval
import javax.swing.border.TitledBorder; //導入依賴的package包/類
/**
* Renders the border and the position of the given panel and adds it to
* the scrolled panel
*
* @param name
* The name of the Interval
* @param panel
* The panel which will contain the interval
*/
protected void addInterval(String name, JPanel panel) {
GridBagLayout gridbag = new GridBagLayout();
// Use gridbag layout
panel.setLayout(gridbag);
// Set black border around the interval.
// The name of the interval is displayed on the border
panel.setBorder(BorderFactory.createTitledBorder(BorderFactory
.createMatteBorder(1, 1, 1, 1, Color.BLACK), name,
TitledBorder.DEFAULT_JUSTIFICATION,
TitledBorder.DEFAULT_POSITION, new Font("Dialog",
Font.BOLD, 12), Color.BLACK));
burstContentPanel.add(panel);
}