Java 类javax.swing.border.TitledBorder 实例源码

项目:openjdk-jdk10    文件:TitledBorderLabelUITest.java   
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);
        }
    }
项目:litiengine    文件:CollisionBoxPanel.java   
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();
}
项目:code-sentinel    文件:NewEnvironmentGUI.java   
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);
}
项目:WordnetLoom    文件:RelationTypePropertiesPanel.java   
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);
}
项目:incubator-netbeans    文件:RadioInplaceEditor.java   
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);
    }
}
项目:QN-ACTR-Release    文件:RoutingProbabilitiesEditor.java   
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);
}
项目:jaer    文件:FilterPanel.java   
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);
}
项目:jmt    文件:ClassSwitchSectionPanel.java   
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);
    }
}
项目:code-sentinel    文件:KillAgentGUI.java   
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");
}
项目:jmt    文件:JoinSectionPanel.java   
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);
}
项目:openjdk-jdk10    文件:XMBeanInfo.java   
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));
}
项目:jmt    文件:SemaphoreSectionPanel.java   
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);
}
项目:jmt    文件:RoutingSectionPanel.java   
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);
}
项目:jmt    文件:SemaphoreEditor.java   
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);
}
项目:jmt    文件:DistributionsEditor.java   
/**
 * 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);
}
项目:Pixie    文件:AttributesDefinition.java   
/**
 * Add the tree panel to the view and configure other gui components.
 */
private void configureObjAttribTree() {
    // set the position of the tree panel
    java.awt.GridBagConstraints gbc = new java.awt.GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.fill = java.awt.GridBagConstraints.BOTH;
    gbc.weightx = 0.01;
    gbc.weighty = 0.01;

    jPObjAttribPreviewTree.add(objTreePanel, gbc);
    objTreePanel.addObserver(this);

    // set the title of the panel
    TitledBorder titledBorder = BorderFactory.createTitledBorder(Constants.OBJECT_ATTRIBUTES_TEXT);
    jPObjAttribButtons.setBorder(titledBorder);

    objTreePanel.selectRoot();

    objTreePanel.expandRows();
}
项目:SE2Project    文件:KundenauflisterUI.java   
/**
 * Erzeugt die Tabelle für die Anzeige der Kunden.
 */
private void erzeugeKundenTable()
{
    JScrollPane kundenAuflisterScrollPane = new JScrollPane();
    kundenAuflisterScrollPane.setBorder(BorderFactory.createTitledBorder(
            null, "Kunden", TitledBorder.LEADING,
            TitledBorder.DEFAULT_POSITION, UIConstants.HEADER_FONT));
    kundenAuflisterScrollPane.setBackground(UIConstants.BACKGROUND_COLOR);
    kundenAuflisterScrollPane.getVerticalScrollBar()
        .setBackground(UIConstants.BACKGROUND_COLOR);
    kundenAuflisterScrollPane.getHorizontalScrollBar()
        .setBackground(UIConstants.BACKGROUND_COLOR);

    _kundenTableModel = new KundenTableModel();
    _kundenTable = new JTable();
    kundenAuflisterScrollPane.setViewportView(_kundenTable);
    _kundenTable.setModel(_kundenTableModel);
    _kundenTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    JTableHeader tableHeader = _kundenTable.getTableHeader();
    tableHeader.setFont(UIConstants.HEADER_FONT);
    tableHeader.setReorderingAllowed(false);
    tableHeader.setResizingAllowed(false);
    _kundenTable.setFont(UIConstants.TEXT_FONT);

    _hauptPanel.add(kundenAuflisterScrollPane, BorderLayout.CENTER);
}
项目:jaer    文件:SampledSoundSelector.java   
/** Creates new form DrumSelector.
 * @param player the DrumSound to control.
 */
public SampledSoundSelector (SampledSoundPlayer player){
    drumSound = player;
    names = SampledSoundPlayer.getSoundFilePaths();
    ArrayList<String> displayNames = new ArrayList();
    for ( String n:names ){
        try{
            String sn = n.substring(n.lastIndexOf('/') + 1);
            displayNames.add(sn);
        } catch ( Exception e ){
            log.warning(e.toString());
        }
    }
    initComponents();
    instrCB.setModel(new DefaultComboBoxModel(displayNames.toArray()));
    instrCB.setSelectedIndex(player.getSoundNumber());
    TitledBorder b = (TitledBorder)getBorder();
    b.setTitle("Drum #" + player.getDrumNumber());
}
项目:JavaGridControl    文件:FanPanel.java   
public FanPanel(Fan fan, List<FanSpeedProfile> profiles) {
    this.fan = fan;
    for (FanSpeedProfile p : profiles)
        profileBox.addItem(p);
    profileBox.setSelectedItem(fan.getProfile());

    this.setBorder(new TitledBorder("Fan " + (fan.getIndex() + 1)));
    this.setLayout(new GridLayout(4, 1));

    this.add(voltageLabel);
    this.add(currentLabel);
    this.add(rpmLabel);
    this.add(profileBox);

    profileBox.addActionListener(this::updateProfile);
    this.updateProfile(null);
}
项目:OpenJSharp    文件:XMBeanInfo.java   
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));
}
项目:jdk8u-jdk    文件:XMBeanInfo.java   
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));
}
项目:QN-ACTR-Release    文件:RoutingSectionPanel.java   
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);
    //routing strategy selector on the left, routing probabilities editor on the right
    jsp.setBorder(new TitledBorder(new EtchedBorder(), "Routing Strategies"));
    mainPanel.setResizeWeight(.80); // Gives more space to left component
    jsp.setMinimumSize(new Dimension(180, 100));
    mainPanel.setLeftComponent(jsp);
    routingProbEditor.setMinimumSize(new Dimension(160, 100));
    mainPanel.setRightComponent(routingProbEditor);
    add(mainPanel, BorderLayout.CENTER);
}
项目:litiengine    文件:StaticShadowPanel.java   
public StaticShadowPanel() {
  TitledBorder border = new TitledBorder(new LineBorder(new Color(128, 128, 128)), Resources.get("panel_staticShadow"), TitledBorder.LEADING, TitledBorder.TOP, null, null);
  border.setTitleFont(border.getTitleFont().deriveFont(Font.BOLD));
  setBorder(border);

  JLabel lblShadowType = new JLabel(Resources.get("panel_shadowType"));

  comboBoxShadowType = new JComboBox<>();
  comboBoxShadowType.setModel(new DefaultComboBoxModel<StaticShadowType>(StaticShadowType.values()));

  GroupLayout groupLayout = new GroupLayout(this);
  groupLayout.setHorizontalGroup(
      groupLayout.createParallelGroup(Alignment.LEADING)
          .addGroup(groupLayout.createSequentialGroup()
              .addContainerGap()
              .addComponent(lblShadowType, GroupLayout.PREFERRED_SIZE, 51, GroupLayout.PREFERRED_SIZE)
              .addGap(10)
              .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
                  .addGroup(groupLayout.createSequentialGroup()
                      .addComponent(comboBoxShadowType, 0, 95, Short.MAX_VALUE)
                      .addGap(4)))));
  groupLayout.setVerticalGroup(
      groupLayout.createParallelGroup(Alignment.LEADING)
          .addGroup(groupLayout.createSequentialGroup()
              .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                  .addComponent(comboBoxShadowType, GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE)
                  .addComponent(lblShadowType, GroupLayout.PREFERRED_SIZE, 13, GroupLayout.PREFERRED_SIZE))
              .addPreferredGap(ComponentPlacement.UNRELATED)
              .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
  setLayout(groupLayout);

  this.setupChangedListeners();
}
项目:incubator-netbeans    文件:TitledBorderBeanInfo.java   
@Override
protected PropertyDescriptor[] createPropertyDescriptors() throws IntrospectionException {
    PropertyDescriptor[] pds = new PropertyDescriptor[] {
        createRW(TitledBorder.class, "border"), // NOI18N
        createRW(TitledBorder.class, "title"), // NOI18N
        createRW(TitledBorder.class, "titleJustification"), // NOI18N
        createRW(TitledBorder.class, "titlePosition"), // NOI18N
        createRW(TitledBorder.class, "titleColor"), // NOI18N
        createRW(TitledBorder.class, "titleFont"), // NOI18N
    };
    pds[2].setPropertyEditorClass(JustificationPropertyEditor.class);
    pds[3].setPropertyEditorClass(PositionPropertyEditor.class);
    return pds;
}
项目:incubator-netbeans    文件:TitledBorderBeanInfo.java   
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
        }
    );
}
项目:incubator-netbeans    文件:TitledBorderBeanInfo.java   
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
        }
    );
}
项目:incubator-netbeans    文件:JavaTestCreatorConfiguration.java   
/**
 * Adds a border and a title around a given component.
 * If the component already has some border, it is overridden (not kept).
 *
 * @param  component  component the border and title should be added to
 * @param  insets  insets between the component and the titled border
 * @param  title  text of the title
 */
private static void addTitledBorder(JComponent component,
                                    Insets insets,
                                    String title) {
    Border insideBorder = BorderFactory.createEmptyBorder(
            insets.top, insets.left, insets.bottom, insets.right);
    Border outsideBorder = new TitledBorder(
            BorderFactory.createEtchedBorder(), title);
    component.setBorder(new CompoundBorder(outsideBorder, insideBorder));
}
项目:jdk8u-jdk    文件:XMBeanInfo.java   
public void addMBeanInfo(XMBean mbean, MBeanInfo mbeanInfo) {
    emptyInfoTable();
    emptyDescTable();
    ((TitledBorder) infoBorderPanel.getBorder()).setTitle(
            Messages.MBEAN_INFO);
    String text = Messages.INFO + ":";
    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.OBJECT_NAME;
    rowData[1] = mbean.getObjectName();
    tableModel.addRow(rowData);
    rowData[0] = Messages.CLASS_NAME;
    rowData[1] = mbeanInfo.getClassName();
    tableModel.addRow(rowData);
    rowData[0] = Messages.DESCRIPTION;
    rowData[1] = mbeanInfo.getDescription();
    tableModel.addRow(rowData);
    addDescriptor(mbeanInfo.getDescriptor(), text);
    // MBeanConstructorInfo
    //
    int i = 0;
    for (MBeanConstructorInfo mbci : mbeanInfo.getConstructors()) {
        addMBeanConstructorInfo(mbci,
                Messages.CONSTRUCTOR + "-" + i + ":");
        // MBeanParameterInfo
        //
        int j = 0;
        for (MBeanParameterInfo mbpi : mbci.getSignature()) {
            addMBeanParameterInfo(mbpi,
                    Messages.PARAMETER + "-" + i + "-" + j + ":");
            j++;
        }
        i++;
    }
    tableModel.newDataAvailable(new TableModelEvent(tableModel));
}
项目:JavaGridControl    文件:SensorZone.java   
public SensorZone(String name, List<String> sensors) {
    this.setBorder(new TitledBorder(name + ":"));

    DefaultListModel<String> model = new DefaultListModel<>();
    for (String s : sensors)
        model.addElement(s);
    this.sensors.setModel(model);
    this.setViewportView(this.sensors);
}
项目:MFM    文件:MFMUI_Setup.java   
private void fullView() {
    MFMGamePane = new JSplitPane();
    MFMGamePane.setBorder(BorderFactory.createTitledBorder(BorderFactory.createRaisedBevelBorder(), null,
            TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null,
            new Color(-3407821)));
    MFMGamePane.setOneTouchExpandable(false);

    final JScrollPane scrollPane2 = new JScrollPane();
    scrollPane2.setViewportView(comps.getMachineListTable());
    MFMGamePane.setLeftComponent(scrollPane2);
    MFMGamePane.setRightComponent(comps.ExtrasTabbedPane());
    MFMGamePane.setResizeWeight(.65);

    MFMmainPane.setRightComponent(MFMGamePane);
}
项目:incubator-netbeans    文件:Utils.java   
public static Font getTitledBorderFont(TitledBorder tb) {
    Font font = tb.getTitleFont();
    if (font == null) font = UIManager.getFont("TitledBorder.font"); // NOI18N
    if (font == null) font = new JLabel().getFont();
    if (font == null) font = UIManager.getFont("Label.font"); // NOI18N
    return font;
}
项目:incubator-netbeans    文件:RadioInplaceEditor.java   
public void setUseTitle(boolean val) {
    if (useTitle != val) {
        useTitle = val;

        if (env != null) {
            setBorder(new TitledBorder(env.getFeatureDescriptor().getDisplayName()));
        }
    }
}
项目:incubator-netbeans    文件:CommonTestsCfgOfCreate.java   
/**
 * Adds a border and a title around a given component.
 * If the component already has some border, it is overridden (not kept).
 *
 * @param  component  component the border and title should be added to
 * @param  insets  insets between the component and the titled border
 * @param  title  text of the title
 */
private static void addTitledBorder(JComponent component,
                                    Insets insets,
                                    String title) {
    Border insideBorder = BorderFactory.createEmptyBorder(
            insets.top, insets.left, insets.bottom, insets.right);
    Border outsideBorder = new TitledBorder(
            BorderFactory.createEtchedBorder(), title);
    component.setBorder(new CompoundBorder(outsideBorder, insideBorder));
}
项目:incubator-netbeans    文件:CommonTestsCfgOfCreate.java   
/**
 */
private static void disableBorderTitle(TitledBorder border) {
    final Color color = UIManager.getColor(
            "Label.disabledForeground");                        //NOI18N
    if (color != null) {
        border.setTitleColor(color);
    }
}
项目:incubator-netbeans    文件:UEventSetPatternPanel.java   
/** Initializes the Form */
public UEventSetPatternPanel( PatternAnalyser patternAnalyser ) {
    this.patternAnalyser = patternAnalyser;

    initComponents ();
    initAccessibility();

    for( int i = 0; i < BeanUtils.WELL_KNOWN_LISTENERS.length; i++ ) {
        typeComboBox.addItem( BeanUtils.WELL_KNOWN_LISTENERS[i] );
    }
    typeComboBox.setSelectedItem( "" ); // NOI18N

    javax.swing.ButtonGroup bg = new javax.swing.ButtonGroup();
    bg.add( emptyRadioButton );
    bg.add( implRadioButton );

    ((TitledBorder)eventSetPanel.getBorder()).setTitle(
        getString( "CTL_UEventSetPanel_eventSetPanel" ));
    ((TitledBorder)optionsPanel.getBorder()).setTitle(
        getString( "CTL_UEventSetPanel_optionsPanel" ) );
    typeLabel.setText( getString( "CTL_UEventSetPanel_typeLabel" ) );
    typeLabel.setDisplayedMnemonic(getString("CTL_UEventSetPanel_typeLabel_Mnemonic").charAt(0));
    typeLabel.setLabelFor(typeComboBox);
    typeComboBox.setToolTipText(getString("ACS_UEventSetPanel_typeComboBoxA11yDesc"));
    textLabel.setText( getString( "CTL_UEventSetPanel_textLabel" ) );
    emptyRadioButton.setText( getString( "CTL_UEventSetPanel_emptyRadioButton" ) );
    emptyRadioButton.setMnemonic(getString("CTL_UEventSetPanel_emptyRadioButton_Mnemonic").charAt(0));
    emptyRadioButton.setToolTipText(getString("ACS_UEventSetPanel_emptyRadioButtonA11yDesc"));
    implRadioButton.setText( getString( "CTL_UEventSetPanel_implRadioButton" ) );
    implRadioButton.setMnemonic(getString("CTL_UEventSetPanel_implRadioButton_Mnemonic").charAt(0));
    implRadioButton.setToolTipText(getString("ACS_UEventSetPanel_implRadioButtonA11yDesc"));
    fireCheckBox.setText( getString( "CTL_UEventSetPanel_fireCheckBox" ) );
    fireCheckBox.setMnemonic(getString("CTL_UEventSetPanel_fireCheckBox_Mnemonic").charAt(0));
    fireCheckBox.setToolTipText(getString("ACS_UEventSetPanel_fireCheckBoxA11yDesc"));
    passEventCheckBox.setText( getString( "CTL_UEventSetPanel_passEventCheckBox" ) );
    passEventCheckBox.setMnemonic(getString("CTL_UEventSetPanel_passEventCheckBox_Mnemonic").charAt(0));
    passEventCheckBox.setToolTipText(getString("ACS_UEventSetPanel_passEventCheckBoxA11yDesc"));

    HelpCtx.setHelpIDString(this, HelpCtxKeys.BEAN_EVENTSETS_HELP); //NOI18N
}
项目:incubator-netbeans    文件:BorderBuilders.java   
TitledBorderBuilder(Instance instance, Heap heap) {
    super(instance, heap);

    title = Utils.getFieldString(instance, "title");
    border = fromField(instance, "border", false, heap);
    titlePosition = DetailsUtils.getIntFieldValue(instance, "titlePosition", TitledBorder.DEFAULT_POSITION);
    titleJustification = DetailsUtils.getIntFieldValue(instance, "titleJustification", TitledBorder.LEADING);
    titleFont = FontBuilder.fromField(instance, "titleFont", heap);
    titleColor = ColorBuilder.fromField(instance, "titleColor", heap);
}
项目:rapidminer    文件:ButtonDialog.java   
public static TitledBorder createTitledBorder(String title) {
    TitledBorder border = new TitledBorder(createBorder(), title) {

        private static final long serialVersionUID = 3113821577644055057L;

        @Override
        public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
            super.paintBorder(c, g, x - EDGE_SPACING, y, width + 2 * EDGE_SPACING, height);
        }
    };
    return border;
}
项目:openjdk-jdk10    文件:javax_swing_border_TitledBorder.java   
protected TitledBorder getObject() {
    return new TitledBorder(
            new EmptyBorder(1, 2, 3, 4),
            "TITLE",
            TitledBorder.CENTER,
            TitledBorder.ABOVE_TOP,
            new Font("Arial", Font.ITALIC, 12),
            Color.RED);
}
项目:jdk8u-jdk    文件:LaunchTool.java   
ArgRep(Connector.Argument arg) {
    this.arg = arg;
    panel = new JPanel();
    Border etched = BorderFactory.createEtchedBorder();
    Border titled = BorderFactory.createTitledBorder(etched,
                              arg.description(),
                              TitledBorder.LEFT, TitledBorder.TOP);
    panel.setBorder(titled);
}
项目:jmt    文件:InputSectionPanel.java   
private void initComponents() {
    this.setBorder(new EmptyBorder(5, 5, 5, 5));
    this.setLayout(new BorderLayout(5, 5));
    infiniteQueueSelector = new JRadioButton("Infinite");
    finiteQueueSelector = new JRadioButton("Finite");
    queueLengthGroup = new ButtonGroup();
    queueLengthGroup.add(infiniteQueueSelector);
    queueLengthGroup.add(finiteQueueSelector);
    queueLengthSpinner = new JSpinner();
    queueLengthSpinner.setValue(new Integer(1));
    queueLengthSpinner.setPreferredSize(DIM_BUTTON_XS);
    queueTable = new QueueTable();

    //queue details panel
    JPanel queuePolicyPanel = new JPanel(new BorderLayout());
    queuePolicyPanel.setBorder(new TitledBorder(new EtchedBorder(), "Queue Policy"));
    queuePolicyPanel.add(new WarningScrollTable(queueTable, WARNING_CLASS), BorderLayout.CENTER);
    JPanel queueLengthPanel = new JPanel(new GridLayout(3, 1, 3, 3));
    queueLengthPanel.setBorder(new TitledBorder(new EtchedBorder(), "Capacity"));

    // Queue strategy selector
    JPanel queueStrategy = new JPanel(new BorderLayout());
    queueStrategy.add(new JLabel("Station queue policy: "), BorderLayout.WEST);
    queuePolicyCombo = new JComboBox();
    queueStrategy.add(queuePolicyCombo, BorderLayout.CENTER);
    queuePolicyPanel.add(queueStrategy, BorderLayout.NORTH);
    queueStrategy.setBorder(BorderFactory.createEmptyBorder(2, 5, 10, 5));

    queueLengthPanel.add(infiniteQueueSelector);
    queueLengthPanel.add(finiteQueueSelector);
    JPanel spinnerPanel = new JPanel();
    JLabel label = new JLabel("<html>Max no. customers <br>(queue+service)</html>");
    label.setToolTipText("The maximum number of customers allowed in the station.");
    spinnerPanel.add(label);
    spinnerPanel.add(queueLengthSpinner);
    queueLengthPanel.add(spinnerPanel);

    this.add(queueLengthPanel, BorderLayout.WEST);
    this.add(queuePolicyPanel, BorderLayout.CENTER);
}