javax.swing.JLabel.setMaximumSize()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(8.9k)|赞(0)|评价(0)|浏览(167)

本文整理了Java中javax.swing.JLabel.setMaximumSize()方法的一些代码示例,展示了JLabel.setMaximumSize()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JLabel.setMaximumSize()方法的具体详情如下:
包路径:javax.swing.JLabel
类名称:JLabel
方法名:setMaximumSize

JLabel.setMaximumSize介绍

暂无

代码示例

代码示例来源:origin: runelite/runelite

UICombinedActionSlot(SpriteManager spriteManager)
{
  setLayout(new BorderLayout());
  setBackground(ColorScheme.DARKER_GRAY_COLOR);
  setBorder(BorderFactory.createEmptyBorder(7, 7, 7, 7));
  JLabel uiIcon = new JLabel();
  uiIcon.setBorder(new EmptyBorder(0, 0, 0, 5));
  spriteManager.addSpriteTo(uiIcon, 582, 0);
  uiIcon.setMinimumSize(ICON_SIZE);
  uiIcon.setMaximumSize(ICON_SIZE);
  uiIcon.setPreferredSize(ICON_SIZE);
  uiIcon.setHorizontalAlignment(JLabel.CENTER);
  add(uiIcon, BorderLayout.LINE_START);
  JPanel uiInfo = new JPanel(new GridLayout(2, 1));
  uiInfo.setBackground(ColorScheme.DARKER_GRAY_COLOR);
  uiLabelTitle = new JShadowedLabel("No Action Selected");
  uiLabelTitle.setForeground(Color.WHITE);
  uiLabelActions = new JShadowedLabel("Shift-click to select multiple");
  uiLabelActions.setFont(FontManager.getRunescapeSmallFont());
  uiLabelActions.setForeground(ColorScheme.LIGHT_GRAY_COLOR);
  uiInfo.add(uiLabelTitle);
  uiInfo.add(uiLabelActions);
  add(uiInfo, BorderLayout.CENTER);
}

代码示例来源:origin: runelite/runelite

itemName.setMaximumSize(new Dimension(0, 0));        // to limit the label's size for
itemName.setPreferredSize(new Dimension(0, 0));    // items with longer names
itemName.setText(name);

代码示例来源:origin: igniterealtime/Smack

label.setMaximumSize(new java.awt.Dimension(150, 14));
connPanel.add(
    label,
label.setMaximumSize(new java.awt.Dimension(150, 14));
connPanel.add(
    label,
label.setMaximumSize(new java.awt.Dimension(150, 14));
connPanel.add(
    label,
label.setMaximumSize(new java.awt.Dimension(150, 14));
connPanel.add(
    label,
label.setMaximumSize(new java.awt.Dimension(150, 14));
connPanel.add(
    label,

代码示例来源:origin: runelite/runelite

uiIcon.setMaximumSize(ICON_SIZE);
uiIcon.setPreferredSize(ICON_SIZE);
uiIcon.setHorizontalAlignment(JLabel.CENTER);

代码示例来源:origin: magefree/mage

public CountryItemEditor() {
  panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
  panel.setBackground(new Color(0, 100,190, 255));
  panel.add(labelItem);
  labelItem.setAlignmentX(Component.LEFT_ALIGNMENT);
  labelItem.setMaximumSize(new Dimension(Short.MAX_VALUE, Short.MAX_VALUE));
  labelItem.setBorder(new EmptyBorder(0, 5, 0, 0));
  labelItem.setOpaque(false);
  labelItem.setForeground(Color.WHITE);
  editValue = null;
}

代码示例来源:origin: nodebox/nodebox

/**
 * Add a header label that cannot be selected.
 *
 * @param s the name of the header.
 */
public void addHeader(String s) {
  JLabel header = new JLabel(s);
  header.setForeground(Theme.TEXT_HEADER_COLOR);
  header.setFont(Theme.SMALL_BOLD_FONT);
  header.setMinimumSize(new Dimension(100, 25));
  header.setMaximumSize(new Dimension(500, 25));
  header.setPreferredSize(new Dimension(140, 25));
  header.setAlignmentX(JComponent.LEFT_ALIGNMENT);
  header.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
  add(header);
}

代码示例来源:origin: magefree/mage

private void setGUISize() {
  Font font = GUISizeHelper.gameRequestsFont;
  lblText.setFont(font);
  lblText.setMaximumSize(new Dimension(300 + font.getSize() * 15, 20 + font.getSize() * 5));
  lblText.setMinimumSize(new Dimension(300 + font.getSize() * 15, 20 + font.getSize() * 5));
  lblText.setPreferredSize(new Dimension(300 + font.getSize() * 15, 20 + font.getSize() * 5));
  btn1.setFont(font);
  btn1.setMinimumSize(new Dimension(50 + 4 * font.getSize(), 2 * font.getSize() + 10));
  btn1.setMaximumSize(new Dimension(50 + 4 * font.getSize(), 2 * font.getSize() + 10));
  btn1.setPreferredSize(new Dimension(50 + 4 * font.getSize(), 2 * font.getSize() + 10));
  btn2.setFont(font);
  btn2.setMinimumSize(new Dimension(50 + 4 * font.getSize(), 2 * font.getSize() + 10));
  btn2.setMaximumSize(new Dimension(50 + 4 * font.getSize(), 2 * font.getSize() + 10));
  btn2.setPreferredSize(new Dimension(50 + 4 * font.getSize(), 2 * font.getSize() + 10));
  btn3.setFont(font);
  btn3.setMinimumSize(new Dimension(50 + 4 * font.getSize(), 2 * font.getSize() + 10));
  btn3.setMaximumSize(new Dimension(50 + 4 * font.getSize(), 2 * font.getSize() + 10));
  btn3.setPreferredSize(new Dimension(50 + 4 * font.getSize(), 2 * font.getSize() + 10));
  JComponent c = ((BasicInternalFrameUI) this.getUI()).getNorthPane();
  c.setMinimumSize(new Dimension(c.getMinimumSize().width, font.getSize() + 10));
  c.setMaximumSize(new Dimension(c.getMaximumSize().width, font.getSize() + 10));
  c.setPreferredSize(new Dimension(c.getPreferredSize().width, font.getSize() + 10));
  c.setFont(font);
}

代码示例来源:origin: magefree/mage

lblText.setMaximumSize(new java.awt.Dimension(1000, 500));
lblText.setMinimumSize(new java.awt.Dimension(400, 60));
lblText.setPreferredSize(new java.awt.Dimension(400, 60));

代码示例来源:origin: nodebox/nodebox

alert.setAlignmentX(Component.LEFT_ALIGNMENT);
alert.setPreferredSize(new Dimension(Short.MAX_VALUE, 80));
alert.setMaximumSize(new Dimension(Short.MAX_VALUE, 80));
alert.setVerticalTextPosition(SwingConstants.TOP);
controlsPanel.add(alert);

代码示例来源:origin: magefree/mage

lblForestIcon.setMaximumSize(new java.awt.Dimension(22, 20));
lblForestIcon.setMinimumSize(new java.awt.Dimension(22, 20));
lblForestIcon.setPreferredSize(new java.awt.Dimension(22, 20));
lblIslandIcon.setMaximumSize(new java.awt.Dimension(22, 20));
lblIslandIcon.setMinimumSize(new java.awt.Dimension(22, 20));
lblIslandIcon.setPreferredSize(new java.awt.Dimension(22, 20));
lblMountainIcon.setMaximumSize(new java.awt.Dimension(22, 20));
lblMountainIcon.setMinimumSize(new java.awt.Dimension(22, 20));
lblMountainIcon.setPreferredSize(new java.awt.Dimension(22, 20));
lblPlainsIcon.setMaximumSize(new java.awt.Dimension(22, 20));
lblPlainsIcon.setMinimumSize(new java.awt.Dimension(22, 20));
lblPlainsIcon.setPreferredSize(new java.awt.Dimension(22, 20));
lblSwampIcon.setMaximumSize(new java.awt.Dimension(22, 20));
lblSwampIcon.setMinimumSize(new java.awt.Dimension(22, 20));
lblSwampIcon.setPreferredSize(new java.awt.Dimension(22, 20));

代码示例来源:origin: nodebox/nodebox

alert.setAlignmentX(Component.LEFT_ALIGNMENT);
alert.setPreferredSize(new Dimension(Short.MAX_VALUE, 80));
alert.setMaximumSize(new Dimension(Short.MAX_VALUE, 80));
alert.setVerticalTextPosition(SwingConstants.TOP);
controlsPanel.add(alert);

代码示例来源:origin: RaiMan/SikuliX2

titleBar.setMaximumSize(new Dimension(Integer.MAX_VALUE,Integer.MAX_VALUE));
buttons.setMaximumSize(new Dimension(Integer.MAX_VALUE,Integer.MAX_VALUE));
textPane.setMaximumSize(new Dimension(Integer.MAX_VALUE,Integer.MAX_VALUE));

代码示例来源:origin: winder/Universal-G-Code-Sender

remainingRowsLabel.setText("Remaining Rows:");
remainingRowsLabel.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
remainingRowsLabel.setMaximumSize(null);
remainingRowsLabel.setMinimumSize(new java.awt.Dimension(106, 14));
remainingRowsLabel.setPreferredSize(new java.awt.Dimension(106, 14));
sentRowsLabel.setText("Sent Rows:");
sentRowsLabel.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
sentRowsLabel.setMaximumSize(null);
sentRowsLabel.setMinimumSize(new java.awt.Dimension(106, 14));
sentRowsLabel.setPreferredSize(new java.awt.Dimension(106, 14));

代码示例来源:origin: stackoverflow.com

JLabel label new JLabel("some text");
label.setBorder(....);
Dimension d = label.getPreferredSize();
d.width = 32767;
label.setMaximumSize( d );

代码示例来源:origin: pl.touk/test-generator

private JLabel createLabel(String label)
  {
    JLabel jlabel = new JLabel(label);
    jlabel.setPreferredSize(new Dimension(380, 20));
//        jlabel.setMinimumSize(new Dimension(100, 20));
    jlabel.setMaximumSize(new Dimension(Integer.MAX_VALUE, 20));
    return jlabel;
  }

代码示例来源:origin: stackoverflow.com

final int size = 500;
leftArrowBubble.setMaximumSize(new Dimension(size, size));
JLabel tac = new JLabel();
tac.setMaximumSize(new Dimension(size - 50, size - 50));
// [...]
tac.setText("<html><body style='width:" + (size - 150)
      + "px;padding:15px;display:block;'>"
      + textWithSeparators + "</body></html>");

代码示例来源:origin: cytoscape.coreplugins/quickfind

/**
 * Creates Search Label.
 */
private JLabel createSearchLabel() {
  JLabel label = new JLabel(SEARCH_STRING);
  label.setBorder(new EmptyBorder(0, 5, 0, 0));
  label.setForeground(Color.GRAY);
  //  Fix width of label
  label.setMaximumSize(label.getPreferredSize());
  return label;
}

代码示例来源:origin: stackoverflow.com

leftArrowBubble.setMaximumSize(new Dimension(400,350));
JLabel tac = new JLabel();
tac.setMaximumSize(new Dimension(350,400));
//tac.setPreferredSize(new Dimension(350,50)); //<----------
System.out.println(str);
tac.setText("<html><body style='width:350px;padding:15px;display:block;'>"
      + str + "</body></html>");

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

public void setMaximumSize(Dimension _size)
{
 if((delegate_==this)||(delegate_==null))
  super.setMaximumSize(_size);
 else
  delegate_.setMaximumSize(_size);
}

代码示例来源:origin: nativelibs4java/JavaCL

public static JLabel createLinkLabel(String caption, final Runnable action) {
  JLabel lab = new JLabel("<html><body><a href='#'>" + caption + "</a></body></html>");
  lab.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
  lab.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) {
    action.run();
  }});
  lab.setMaximumSize(lab.getPreferredSize());
  return lab;
}

相关文章

JLabel类方法