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


Java TitledBorder.setTitleFont方法代码示例

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


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

示例1: 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();
}
 
开发者ID:gurkenlabs,项目名称:litiengine,代码行数:24,代码来源:CollisionBoxPanel.java

示例2: StaticShadowPanel

import javax.swing.border.TitledBorder; //导入方法依赖的package包/类
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();
}
 
开发者ID:gurkenlabs,项目名称:litiengine,代码行数:34,代码来源:StaticShadowPanel.java

示例3: EmitterPanel

import javax.swing.border.TitledBorder; //导入方法依赖的package包/类
public EmitterPanel() {
  TitledBorder border = new TitledBorder(new LineBorder(new Color(128, 128, 128)), Resources.get("panel_emitter"), TitledBorder.LEADING, TitledBorder.TOP, null, null);
  border.setTitleFont(border.getTitleFont().deriveFont(Font.BOLD));
  setBorder(border);

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

  textFieldType = new JTextField();
  textFieldType.setColumns(10);

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

  this.setupChangedListeners();
}
 
开发者ID:gurkenlabs,项目名称:litiengine,代码行数:31,代码来源:EmitterPanel.java

示例4: initComponents

import javax.swing.border.TitledBorder; //导入方法依赖的package包/类
private void initComponents() {
    setLayout(new BorderLayout());

    JPanel contentsPanel = new JPanel(new BorderLayout());
    contentsPanel.setBackground(UIUtils.getProfilerResultsBackground());
    contentsPanel.setOpaque(true);
    contentsPanel.setBorder(BorderFactory.createMatteBorder(0, 15, 15, 15, UIUtils.getProfilerResultsBackground()));

    headerArea = new HTMLTextArea() {
            protected void showURL(URL url) {
                String urlString = url.toString();

                if (START_LOCATION_URLMASK.equals(urlString)) {
                    Utils.openLocation(StopwatchProfilingPoint.this.getStartLocation());
                } else if (StopwatchProfilingPoint.this.usesEndLocation()) {
                    Utils.openLocation(StopwatchProfilingPoint.this.getEndLocation());
                }
            }
        };

    JScrollPane headerAreaScrollPane = new JScrollPane(headerArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                                       JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    headerAreaScrollPane.setBorder(BorderFactory.createMatteBorder(0, 0, 15, 0, UIUtils.getProfilerResultsBackground()));
    headerAreaScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
    contentsPanel.add(headerAreaScrollPane, BorderLayout.NORTH);

    dataArea = new HTMLTextArea();

    JScrollPane dataAreaScrollPane = new JScrollPane(dataArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                                     JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    TitledBorder tb = new TitledBorder(Bundle.StopwatchProfilingPoint_DataString());
    tb.setTitleFont(Utils.getTitledBorderFont(tb).deriveFont(Font.BOLD));
    tb.setTitleColor(javax.swing.UIManager.getColor("Label.foreground")); // NOI18N
    dataAreaScrollPane.setBorder(tb);
    dataAreaScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
    dataAreaScrollPane.setBackground(UIUtils.getProfilerResultsBackground());
    contentsPanel.add(dataAreaScrollPane, BorderLayout.CENTER);

    add(contentsPanel, BorderLayout.CENTER);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:41,代码来源:StopwatchProfilingPoint.java

示例5: initComponents

import javax.swing.border.TitledBorder; //导入方法依赖的package包/类
private void initComponents() {
    setLayout(new BorderLayout());

    JPanel contentsPanel = new JPanel(new BorderLayout());
    contentsPanel.setBackground(UIUtils.getProfilerResultsBackground());
    contentsPanel.setOpaque(true);
    contentsPanel.setBorder(BorderFactory.createMatteBorder(0, 15, 15, 15, UIUtils.getProfilerResultsBackground()));

    headerArea = new HTMLTextArea() {
            protected void showURL(URL url) {
                Utils.openLocation(ResetResultsProfilingPoint.this.getLocation());
            }
        };

    JScrollPane headerAreaScrollPane = new JScrollPane(headerArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                                       JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    headerAreaScrollPane.setBorder(BorderFactory.createMatteBorder(0, 0, 15, 0, UIUtils.getProfilerResultsBackground()));
    headerAreaScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
    contentsPanel.add(headerAreaScrollPane, BorderLayout.NORTH);

    dataArea = new HTMLTextArea();

    JScrollPane dataAreaScrollPane = new JScrollPane(dataArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                                     JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    TitledBorder tb = new TitledBorder(Bundle.ResetResultsProfilingPoint_DataString());
    tb.setTitleFont(Utils.getTitledBorderFont(tb).deriveFont(Font.BOLD));
    tb.setTitleColor(javax.swing.UIManager.getColor("Label.foreground")); // NOI18N
    dataAreaScrollPane.setBorder(tb);
    dataAreaScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
    dataAreaScrollPane.setBackground(UIUtils.getProfilerResultsBackground());
    contentsPanel.add(dataAreaScrollPane, BorderLayout.CENTER);

    add(contentsPanel, BorderLayout.CENTER);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:35,代码来源:ResetResultsProfilingPoint.java

示例6: initComponents

import javax.swing.border.TitledBorder; //导入方法依赖的package包/类
private void initComponents() {
    setLayout(new BorderLayout());

    JPanel contentsPanel = new JPanel(new BorderLayout());
    contentsPanel.setBackground(UIUtils.getProfilerResultsBackground());
    contentsPanel.setOpaque(true);
    contentsPanel.setBorder(BorderFactory.createMatteBorder(0, 15, 15, 15, UIUtils.getProfilerResultsBackground()));

    headerArea = new HTMLTextArea() {
            protected void showURL(URL url) {
                String urlString = url.toString();

                if (START_LOCATION_URLMASK.equals(urlString)) {
                    Utils.openLocation(LoadGenProfilingPoint.this.getStartLocation());
                } else if (LoadGenProfilingPoint.this.usesEndLocation()) {
                    Utils.openLocation(LoadGenProfilingPoint.this.getEndLocation());
                }
            }
        };

    JScrollPane headerAreaScrollPane = new JScrollPane(headerArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                                       JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    headerAreaScrollPane.setBorder(BorderFactory.createMatteBorder(0, 0, 15, 0, UIUtils.getProfilerResultsBackground()));
    headerAreaScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
    contentsPanel.add(headerAreaScrollPane, BorderLayout.NORTH);

    dataArea = new HTMLTextArea();

    JScrollPane dataAreaScrollPane = new JScrollPane(dataArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                                     JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    TitledBorder tb = new TitledBorder(Bundle.LoadGenProfilingPoint_DataString());
    tb.setTitleFont(Utils.getTitledBorderFont(tb).deriveFont(Font.BOLD));
    tb.setTitleColor(javax.swing.UIManager.getColor("Label.foreground")); // NOI18N
    dataAreaScrollPane.setBorder(tb);
    dataAreaScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
    dataAreaScrollPane.setBackground(UIUtils.getProfilerResultsBackground());
    contentsPanel.add(dataAreaScrollPane, BorderLayout.CENTER);

    add(contentsPanel, BorderLayout.CENTER);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:41,代码来源:LoadGenProfilingPoint.java

示例7: checkTitleFont

import javax.swing.border.TitledBorder; //导入方法依赖的package包/类
/**
  * Check behaviour of method TitledBorder.getTitleFont()
  */
private static void checkTitleFont() {
    TitledBorder titledBorder = new TitledBorder(new EmptyBorder(1, 1, 1, 1));
    Font defaultFont = UIManager.getLookAndFeelDefaults().getFont("TitledBorder.font");
    Font titledBorderFont = titledBorder.getTitleFont();

    // check default configuration
    if (defaultFont == null) {
        if (titledBorderFont == null) {
            return;
        }
        else {
            throw new RuntimeException("TitledBorder default font should be null");
        }
    }
    if (!defaultFont.equals(titledBorderFont)) {
        throw new RuntimeException("L&F default font " + defaultFont.toString()
                                 + " differs from TitledBorder font " + titledBorderFont.toString());
    }

    // title font is explicitly specified
    Font font = new Font("Dialog", Font.PLAIN, 10);
    titledBorder.setTitleFont(font);
    if (!font.equals(titledBorder.getTitleFont())) {
        throw new RuntimeException("TitledBorder font should be " + font.toString());
    }

    // title Font is unspecified
    titledBorder.setTitleFont(null);
    if (!defaultFont.equals(titledBorder.getTitleFont())) {
        throw new RuntimeException("L&F default font " + defaultFont.toString()
                                 + " differs from TitledBorder font " + titledBorderFont.toString());
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:37,代码来源:Test7022041.java

示例8: SpawnpointPanel

import javax.swing.border.TitledBorder; //导入方法依赖的package包/类
public SpawnpointPanel() {
  TitledBorder border = new TitledBorder(new LineBorder(new Color(128, 128, 128)), Resources.get("panel_spawnPoint"), TitledBorder.LEADING, TitledBorder.TOP, null, null);
  border.setTitleFont(border.getTitleFont().deriveFont(Font.BOLD));
  setBorder(border);

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

  textFieldType = new JTextField();
  textFieldType.setColumns(10);

  JLabel lblDirection = new JLabel(Resources.get("panel_direction"));

  comboBoxDirection = new JComboBox<>();
  comboBoxDirection.setModel(new DefaultComboBoxModel<Direction>(Direction.values()));

  GroupLayout groupLayout = new GroupLayout(this);
  groupLayout.setHorizontalGroup(
      groupLayout.createParallelGroup(Alignment.LEADING)
          .addGroup(groupLayout.createSequentialGroup()
              .addContainerGap()
              .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
                  .addGroup(groupLayout.createSequentialGroup()
                      .addComponent(lblShadowType, GroupLayout.PREFERRED_SIZE, 51, GroupLayout.PREFERRED_SIZE)
                      .addPreferredGap(ComponentPlacement.RELATED)
                      .addComponent(textFieldType, GroupLayout.DEFAULT_SIZE, 371, Short.MAX_VALUE))
                  .addGroup(groupLayout.createSequentialGroup()
                      .addComponent(lblDirection, GroupLayout.PREFERRED_SIZE, 51, GroupLayout.PREFERRED_SIZE)
                      .addPreferredGap(ComponentPlacement.RELATED)
                      .addComponent(comboBoxDirection, 0, 371, Short.MAX_VALUE)))
              .addGap(4)));
  groupLayout.setVerticalGroup(
      groupLayout.createParallelGroup(Alignment.LEADING)
          .addGroup(groupLayout.createSequentialGroup()
              .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                  .addComponent(lblShadowType, GroupLayout.PREFERRED_SIZE, 13, GroupLayout.PREFERRED_SIZE)
                  .addComponent(textFieldType, GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE))
              .addPreferredGap(ComponentPlacement.RELATED)
              .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                  .addComponent(lblDirection, GroupLayout.PREFERRED_SIZE, 13, GroupLayout.PREFERRED_SIZE)
                  .addComponent(comboBoxDirection, GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE))
              .addContainerGap(226, Short.MAX_VALUE)));
  setLayout(groupLayout);

  this.setupChangedListeners();
}
 
开发者ID:gurkenlabs,项目名称:litiengine,代码行数:46,代码来源:SpawnpointPanel.java

示例9: DecorMobPanel

import javax.swing.border.TitledBorder; //导入方法依赖的package包/类
/**
 * Create the panel.
 */
public DecorMobPanel() {
  TitledBorder border = new TitledBorder(new LineBorder(new Color(128, 128, 128)), Resources.get("panel_decorMob"), TitledBorder.LEADING, TitledBorder.TOP, null, null);
  border.setTitleFont(border.getTitleFont().deriveFont(Font.BOLD));
  setBorder(border);

  JLabel lblSprite = new JLabel(Resources.get("panel_sprite"));

  comboBoxSpriteSheets = new JComboBox<>();
  comboBoxSpriteSheets.setRenderer(new MyComboRenderer());

  JLabel lblBehaviour = new JLabel(Resources.get("panel_behavior"));

  comboBoxBehaviour = new JComboBox<>();
  comboBoxBehaviour.setModel(new DefaultComboBoxModel<MovementBehavior>(MovementBehavior.values()));

  lblVvelocity = new JLabel(Resources.get("panel_velocity"));

  spinnerVelocity = new JSpinner();
  spinnerVelocity.setModel(new SpinnerNumberModel(0, 0, 100, 1));

  chckbxAttackable = new JCheckBox(Resources.get("panel_attackable"));
  GroupLayout groupLayout = new GroupLayout(this);
  groupLayout.setHorizontalGroup(
      groupLayout.createParallelGroup(Alignment.LEADING)
          .addGroup(groupLayout.createSequentialGroup()
              .addContainerGap()
              .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
                  .addGroup(groupLayout.createSequentialGroup()
                      .addComponent(lblSprite, GroupLayout.PREFERRED_SIZE, 51, GroupLayout.PREFERRED_SIZE)
                      .addPreferredGap(ComponentPlacement.RELATED)
                      .addComponent(comboBoxSpriteSheets, 0, 95, Short.MAX_VALUE)
                      .addGap(10))
                  .addGroup(groupLayout.createSequentialGroup()
                      .addComponent(lblBehaviour, GroupLayout.PREFERRED_SIZE, 51, GroupLayout.PREFERRED_SIZE)
                      .addPreferredGap(ComponentPlacement.RELATED)
                      .addComponent(comboBoxBehaviour, 0, 95, Short.MAX_VALUE)
                      .addContainerGap())
                  .addGroup(groupLayout.createSequentialGroup()
                      .addComponent(lblVvelocity, GroupLayout.PREFERRED_SIZE, 51, GroupLayout.PREFERRED_SIZE)
                      .addPreferredGap(ComponentPlacement.RELATED)
                      .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
                          .addGroup(groupLayout.createSequentialGroup()
                              .addComponent(chckbxAttackable, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                              .addGap(28))
                          .addComponent(spinnerVelocity, GroupLayout.DEFAULT_SIZE, 95, Short.MAX_VALUE))
                      .addContainerGap()))));
  groupLayout.setVerticalGroup(
      groupLayout.createParallelGroup(Alignment.LEADING)
          .addGroup(groupLayout.createSequentialGroup()
              .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
                  .addComponent(lblSprite, GroupLayout.PREFERRED_SIZE, 13, GroupLayout.PREFERRED_SIZE)
                  .addComponent(comboBoxSpriteSheets, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
              .addPreferredGap(ComponentPlacement.UNRELATED)
              .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                  .addComponent(lblBehaviour, GroupLayout.PREFERRED_SIZE, 13, GroupLayout.PREFERRED_SIZE)
                  .addComponent(comboBoxBehaviour, GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE))
              .addPreferredGap(ComponentPlacement.UNRELATED)
              .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                  .addComponent(lblVvelocity, GroupLayout.PREFERRED_SIZE, 13, GroupLayout.PREFERRED_SIZE)
                  .addComponent(spinnerVelocity, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
              .addPreferredGap(ComponentPlacement.UNRELATED)
              .addComponent(chckbxAttackable)
              .addContainerGap(171, Short.MAX_VALUE)));
  setLayout(groupLayout);
  this.setupChangedListeners();
}
 
开发者ID:gurkenlabs,项目名称:litiengine,代码行数:70,代码来源:DecorMobPanel.java

示例10: PropPanel

import javax.swing.border.TitledBorder; //导入方法依赖的package包/类
/**
 * Create the panel.
 */
public PropPanel() {
  TitledBorder border = new TitledBorder(new LineBorder(new Color(128, 128, 128)), Resources.get("panel_prop"), TitledBorder.LEADING, TitledBorder.TOP, null, null);
  border.setTitleFont(border.getTitleFont().deriveFont(Font.BOLD));
  setBorder(border);

  JLabel lblHealth = new JLabel(Resources.get("panel_health"));

  spinnerHealth = new JSpinner();
  spinnerHealth.setModel(new SpinnerNumberModel(100, 0, 1000000, 1));

  JLabel lblMaterial = new JLabel(Resources.get("panel_material"));

  comboBoxMaterial = new JComboBox<>();
  comboBoxMaterial.setModel(new DefaultComboBoxModel<Material>(Material.values()));

  JLabel lblSprite = new JLabel(Resources.get("panel_sprite"));

  comboBoxSpriteSheets = new JComboBox<>();
  comboBoxSpriteSheets.setRenderer(new MyComboRenderer());

  chckbxIndestructible = new JCheckBox(Resources.get("panel_destructible"));

  chckbxIsObstacle = new JCheckBox(Resources.get("panel_isObstacle"));

  chckbxShadow = new JCheckBox("shadow");
  GroupLayout groupLayout = new GroupLayout(this);
  groupLayout.setHorizontalGroup(
      groupLayout.createParallelGroup(Alignment.LEADING)
          .addGroup(groupLayout.createSequentialGroup()
              .addContainerGap()
              .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
                  .addComponent(lblHealth, GroupLayout.PREFERRED_SIZE, 51, GroupLayout.PREFERRED_SIZE)
                  .addComponent(lblMaterial, GroupLayout.PREFERRED_SIZE, 51, GroupLayout.PREFERRED_SIZE)
                  .addComponent(lblSprite, GroupLayout.PREFERRED_SIZE, 51, GroupLayout.PREFERRED_SIZE))
              .addPreferredGap(ComponentPlacement.RELATED)
              .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
                  .addComponent(chckbxShadow, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE)
                  .addComponent(comboBoxMaterial, 0, 365, Short.MAX_VALUE)
                  .addComponent(spinnerHealth, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                  .addComponent(comboBoxSpriteSheets, 0, 365, Short.MAX_VALUE)
                  .addGroup(groupLayout.createParallelGroup(Alignment.TRAILING, false)
                      .addComponent(chckbxIsObstacle, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                      .addComponent(chckbxIndestructible, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
              .addContainerGap()));
  groupLayout.setVerticalGroup(
      groupLayout.createParallelGroup(Alignment.LEADING)
          .addGroup(groupLayout.createSequentialGroup()
              .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                  .addComponent(lblHealth, GroupLayout.PREFERRED_SIZE, 13, GroupLayout.PREFERRED_SIZE)
                  .addComponent(spinnerHealth, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE))
              .addPreferredGap(ComponentPlacement.RELATED)
              .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                  .addComponent(lblMaterial, GroupLayout.PREFERRED_SIZE, 13, GroupLayout.PREFERRED_SIZE)
                  .addComponent(comboBoxMaterial, GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE))
              .addPreferredGap(ComponentPlacement.RELATED)
              .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                  .addComponent(comboBoxSpriteSheets, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                  .addComponent(lblSprite, GroupLayout.PREFERRED_SIZE, 13, GroupLayout.PREFERRED_SIZE))
              .addPreferredGap(ComponentPlacement.RELATED)
              .addComponent(chckbxIndestructible)
              .addPreferredGap(ComponentPlacement.UNRELATED)
              .addComponent(chckbxIsObstacle, GroupLayout.PREFERRED_SIZE, 21, GroupLayout.PREFERRED_SIZE)
              .addPreferredGap(ComponentPlacement.RELATED)
              .addComponent(chckbxShadow, GroupLayout.PREFERRED_SIZE, 21, GroupLayout.PREFERRED_SIZE)
              .addContainerGap(138, Short.MAX_VALUE)));
  setLayout(groupLayout);
  this.setupChangedListeners();
}
 
开发者ID:gurkenlabs,项目名称:litiengine,代码行数:72,代码来源:PropPanel.java

示例11: CollisionPanel

import javax.swing.border.TitledBorder; //导入方法依赖的package包/类
/**
 * Create the panel.
 */
public CollisionPanel() {
  TitledBorder border = new TitledBorder(new LineBorder(new Color(128, 128, 128)), Resources.get("panel_collisionEntity"), TitledBorder.LEADING, TitledBorder.TOP, null, null);
  border.setTitleFont(border.getTitleFont().deriveFont(Font.BOLD));
  setBorder(border);

  JLabel lblHealth = new JLabel(Resources.get("panel_collision"));

  JLabel lblMaterial = new JLabel(Resources.get("panel_width"));

  chckbxHasCollision = new JCheckBox(" ");

  JLabel lblHeightFactor = new JLabel(Resources.get("panel_height"));

  spinnerWidth = new JSpinner();
  spinnerWidth.setModel(new SpinnerNumberModel(0, 0, null, 0.5f));

  spinnerHeight = new JSpinner();
  spinnerHeight.setModel(new SpinnerNumberModel(0, 0, null, 0.5f));

  comboBoxAlign = new JComboBox<>();
  comboBoxAlign.setModel(new DefaultComboBoxModel<Align>(Align.values()));

  comboBoxValign = new JComboBox<>();
  comboBoxValign.setModel(new DefaultComboBoxModel<Valign>(Valign.values()));

  GroupLayout groupLayout = new GroupLayout(this);
  groupLayout.setHorizontalGroup(
      groupLayout.createParallelGroup(Alignment.LEADING)
          .addGroup(groupLayout.createSequentialGroup()
              .addContainerGap()
              .addGroup(groupLayout.createParallelGroup(Alignment.LEADING, false)
                  .addGroup(groupLayout.createSequentialGroup()
                      .addComponent(lblHealth, GroupLayout.PREFERRED_SIZE, 51, GroupLayout.PREFERRED_SIZE)
                      .addPreferredGap(ComponentPlacement.RELATED)
                      .addComponent(chckbxHasCollision))
                  .addGroup(groupLayout.createSequentialGroup()
                      .addComponent(lblMaterial, GroupLayout.PREFERRED_SIZE, 31, GroupLayout.PREFERRED_SIZE)
                      .addPreferredGap(ComponentPlacement.RELATED)
                      .addComponent(spinnerWidth))
                  .addGroup(groupLayout.createSequentialGroup()
                      .addComponent(lblHeightFactor)
                      .addPreferredGap(ComponentPlacement.UNRELATED)
                      .addComponent(spinnerHeight, GroupLayout.PREFERRED_SIZE, 44, GroupLayout.PREFERRED_SIZE)))
              .addPreferredGap(ComponentPlacement.RELATED)
              .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
                  .addComponent(comboBoxAlign, 0, 53, Short.MAX_VALUE)
                  .addComponent(comboBoxValign, 0, 53, Short.MAX_VALUE))
              .addContainerGap()));
  groupLayout.setVerticalGroup(
      groupLayout.createParallelGroup(Alignment.LEADING)
          .addGroup(groupLayout.createSequentialGroup()
              .addContainerGap()
              .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                  .addComponent(lblHealth, GroupLayout.PREFERRED_SIZE, 13, GroupLayout.PREFERRED_SIZE)
                  .addComponent(chckbxHasCollision))
              .addPreferredGap(ComponentPlacement.UNRELATED)
              .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                  .addComponent(lblMaterial, GroupLayout.PREFERRED_SIZE, 13, GroupLayout.PREFERRED_SIZE)
                  .addComponent(spinnerWidth, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                  .addComponent(comboBoxAlign, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
              .addPreferredGap(ComponentPlacement.UNRELATED)
              .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                  .addComponent(lblHeightFactor, GroupLayout.PREFERRED_SIZE, 13, GroupLayout.PREFERRED_SIZE)
                  .addComponent(spinnerHeight, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                  .addComponent(comboBoxValign, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
              .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
  setLayout(groupLayout);
  this.setupChangedListeners();
}
 
开发者ID:gurkenlabs,项目名称:litiengine,代码行数:73,代码来源:CollisionPanel.java

示例12: initComponents

import javax.swing.border.TitledBorder; //导入方法依赖的package包/类
private void initComponents() {
    setLayout(new BorderLayout());

    JPanel contentsPanel = new JPanel(new BorderLayout());
    contentsPanel.setBackground(UIUtils.getProfilerResultsBackground());
    contentsPanel.setOpaque(true);
    contentsPanel.setBorder(BorderFactory.createMatteBorder(0, 15, 15, 15, UIUtils.getProfilerResultsBackground()));

    headerArea = new HTMLTextArea();

    JScrollPane headerAreaScrollPane = new JScrollPane(headerArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                                       JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    headerAreaScrollPane.setBorder(BorderFactory.createMatteBorder(0, 0, 15, 0, UIUtils.getProfilerResultsBackground()));
    headerAreaScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
    contentsPanel.add(headerAreaScrollPane, BorderLayout.NORTH);

    dataArea = new HTMLTextArea() {
            protected void showURL(URL url) {
                File resolvedFile = null;

                try {
                    resolvedFile = new File(url.toURI());
                } catch (URISyntaxException ex) {
                    ex.printStackTrace();
                }

                final File snapshotFile = resolvedFile;

                if ((snapshotFile != null) && snapshotFile.exists()) {
                    String type = TimedTakeSnapshotProfilingPoint.this.getSnapshotType();
                    if (type.equals(TYPE_PROFDATA_KEY) || type.equals(TYPE_HEAPDUMP_KEY)) {
                        ResultsManager.getDefault().openSnapshot(snapshotFile);
                    }
                } else {
                    ProfilerDialogs.displayWarning(
                            Bundle.TimedTakeSnapshotProfilingPoint_SnapshotNotAvailableMsg());
                }
            }
        };

    JScrollPane dataAreaScrollPane = new JScrollPane(dataArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                                     JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    TitledBorder tb = new TitledBorder(Bundle.TimedTakeSnapshotProfilingPoint_DataString());
    tb.setTitleFont(Utils.getTitledBorderFont(tb).deriveFont(Font.BOLD));
    tb.setTitleColor(javax.swing.UIManager.getColor("Label.foreground")); // NOI18N
    dataAreaScrollPane.setBorder(tb);
    dataAreaScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
    dataAreaScrollPane.setBackground(UIUtils.getProfilerResultsBackground());
    contentsPanel.add(dataAreaScrollPane, BorderLayout.CENTER);

    add(contentsPanel, BorderLayout.CENTER);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:53,代码来源:TimedTakeSnapshotProfilingPoint.java

示例13: initComponents

import javax.swing.border.TitledBorder; //导入方法依赖的package包/类
private void initComponents() {
    setLayout(new BorderLayout());

    JPanel contentsPanel = new JPanel(new BorderLayout());
    contentsPanel.setBackground(UIUtils.getProfilerResultsBackground());
    contentsPanel.setOpaque(true);
    contentsPanel.setBorder(BorderFactory.createMatteBorder(0, 15, 15, 15, UIUtils.getProfilerResultsBackground()));

    headerArea = new HTMLTextArea() {
            protected void showURL(URL url) {
                Utils.openLocation(TakeSnapshotProfilingPoint.this.getLocation());
            }
        };

    JScrollPane headerAreaScrollPane = new JScrollPane(headerArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                                       JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    headerAreaScrollPane.setBorder(BorderFactory.createMatteBorder(0, 0, 15, 0, UIUtils.getProfilerResultsBackground()));
    headerAreaScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
    contentsPanel.add(headerAreaScrollPane, BorderLayout.NORTH);

    dataArea = new HTMLTextArea() {
            protected void showURL(URL url) {
                File resolvedFile = null;

                try {
                    resolvedFile = new File(url.toURI());
                } catch (URISyntaxException ex) {
                    ex.printStackTrace();
                }

                final File snapshotFile = resolvedFile;

                if ((snapshotFile != null) && snapshotFile.exists()) {
                    String type = TakeSnapshotProfilingPoint.this.getSnapshotType();
                    if (type.equals(TYPE_PROFDATA_KEY) || type.equals(TYPE_HEAPDUMP_KEY)) {
                        ResultsManager.getDefault().openSnapshot(snapshotFile);
                    }
                } else {
                    ProfilerDialogs.displayWarning(
                            Bundle.TakeSnapshotProfilingPoint_SnapshotNotAvailableMsg());
                }
            }
        };

    JScrollPane dataAreaScrollPane = new JScrollPane(dataArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                                     JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    TitledBorder tb = new TitledBorder(Bundle.TakeSnapshotProfilingPoint_DataString());
    tb.setTitleFont(Utils.getTitledBorderFont(tb).deriveFont(Font.BOLD));
    tb.setTitleColor(javax.swing.UIManager.getColor("Label.foreground")); // NOI18N
    dataAreaScrollPane.setBorder(tb);
    dataAreaScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
    dataAreaScrollPane.setBackground(UIUtils.getProfilerResultsBackground());
    contentsPanel.add(dataAreaScrollPane, BorderLayout.CENTER);

    add(contentsPanel, BorderLayout.CENTER);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:57,代码来源:TakeSnapshotProfilingPoint.java

示例14: initComponents

import javax.swing.border.TitledBorder; //导入方法依赖的package包/类
private void initComponents() {
    setLayout(new BorderLayout());

    JPanel contentsPanel = new JPanel(new BorderLayout());
    contentsPanel.setBackground(UIUtils.getProfilerResultsBackground());
    contentsPanel.setOpaque(true);
    contentsPanel.setBorder(BorderFactory.createMatteBorder(0, 15, 15, 15, UIUtils.getProfilerResultsBackground()));

    headerArea = new HTMLTextArea();

    JScrollPane headerAreaScrollPane = new JScrollPane(headerArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                                       JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    headerAreaScrollPane.setBorder(BorderFactory.createMatteBorder(0, 0, 15, 0, UIUtils.getProfilerResultsBackground()));
    headerAreaScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
    contentsPanel.add(headerAreaScrollPane, BorderLayout.NORTH);

    dataArea = new HTMLTextArea() {
            protected void showURL(URL url) {
                File resolvedFile = null;

                try {
                    resolvedFile = new File(url.toURI());
                } catch (URISyntaxException ex) {
                    ex.printStackTrace();
                }

                final File snapshotFile = resolvedFile;

                if ((snapshotFile != null) && snapshotFile.exists()) {
                    String type = TriggeredTakeSnapshotProfilingPoint.this.getSnapshotType();
                    if (type.equals(TYPE_PROFDATA_KEY) || type.equals(TYPE_HEAPDUMP_KEY)) {
                        ResultsManager.getDefault().openSnapshot(snapshotFile);
                    }
                } else {
                    ProfilerDialogs.displayWarning(
                            Bundle.TriggeredTakeSnapshotProfilingPoint_SnapshotNotAvailableMsg());
                }
            }
        };

    JScrollPane dataAreaScrollPane = new JScrollPane(dataArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                                     JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    TitledBorder tb = new TitledBorder(Bundle.TriggeredTakeSnapshotProfilingPoint_DataString());
    tb.setTitleFont(Utils.getTitledBorderFont(tb).deriveFont(Font.BOLD));
    tb.setTitleColor(javax.swing.UIManager.getColor("Label.foreground")); // NOI18N
    dataAreaScrollPane.setBorder(tb);
    dataAreaScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
    dataAreaScrollPane.setBackground(UIUtils.getProfilerResultsBackground());
    contentsPanel.add(dataAreaScrollPane, BorderLayout.CENTER);

    add(contentsPanel, BorderLayout.CENTER);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:53,代码来源:TriggeredTakeSnapshotProfilingPoint.java

示例15: getTitledBorder

import javax.swing.border.TitledBorder; //导入方法依赖的package包/类
final public static TitledBorder getTitledBorder(String strPtitle, Font objPfont) {
	final TitledBorder objLtitledBorder = BorderFactory.createTitledBorder(Strings.doConcat(' ', strPtitle, ' '));
	objLtitledBorder.setTitleFont(objPfont);
	return objLtitledBorder;
}
 
开发者ID:jugglemaster,项目名称:JuggleMasterPro,代码行数:6,代码来源:Tools.java


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