本文整理了Java中javax.swing.JButton.setMinimumSize()
方法的一些代码示例,展示了JButton.setMinimumSize()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JButton.setMinimumSize()
方法的具体详情如下:
包路径:javax.swing.JButton
类名称:JButton
方法名:setMinimumSize
暂无
代码示例来源:origin: runelite/runelite
/**
* Creates an empty JButton to be used as the scroll bar's arrows (to disable the arrows).
*/
protected JButton createEmptyButton()
{
JButton button = new JButton();
Dimension zeroDim = new Dimension(0, 0);
button.setPreferredSize(zeroDim);
button.setMinimumSize(zeroDim);
button.setMaximumSize(zeroDim);
return button;
}
代码示例来源:origin: kiegroup/optaplanner
solvePanel.add(solveButton, "solveAction");
solvePanel.add(terminateSolvingEarlyButton, "terminateSolvingEarlyAction");
solveButton.setMinimumSize(terminateSolvingEarlyButton.getMinimumSize());
solveButton.setPreferredSize(terminateSolvingEarlyButton.getPreferredSize());
代码示例来源:origin: kiegroup/optaplanner
if (queen.getRow() != null && queen.getRow().getIndex() == row) {
JButton button = new JButton(new QueenAction(queen));
button.setMinimumSize(new Dimension(20, 20));
button.setPreferredSize(new Dimension(20, 20));
button.setToolTipText(toolTip);
代码示例来源:origin: marytts/marytts
jButton_Record.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
jButton_Record.setMaximumSize(new java.awt.Dimension(95, 25));
jButton_Record.setMinimumSize(new java.awt.Dimension(95, 25));
jButton_Record.setPreferredSize(new java.awt.Dimension(95, 25));
jButton_Record.addActionListener(new java.awt.event.ActionListener() {
jButton_Play.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
jButton_Play.setMaximumSize(new java.awt.Dimension(95, 25));
jButton_Play.setMinimumSize(new java.awt.Dimension(95, 25));
jButton_Play.setPreferredSize(new java.awt.Dimension(95, 25));
jButton_Play.addActionListener(new java.awt.event.ActionListener() {
代码示例来源:origin: marytts/marytts
jButton_Record.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
jButton_Record.setMaximumSize(new java.awt.Dimension(95, 25));
jButton_Record.setMinimumSize(new java.awt.Dimension(95, 25));
jButton_Record.setPreferredSize(new java.awt.Dimension(95, 25));
jButton_Record.addActionListener(new java.awt.event.ActionListener() {
jButton_Play.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
jButton_Play.setMaximumSize(new java.awt.Dimension(95, 25));
jButton_Play.setMinimumSize(new java.awt.Dimension(95, 25));
jButton_Play.setPreferredSize(new java.awt.Dimension(95, 25));
jButton_Play.addActionListener(new java.awt.event.ActionListener() {
代码示例来源: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
btn3.setMinimumSize(new java.awt.Dimension(75, 25));
btn3.setPreferredSize(new java.awt.Dimension(150, 50));
btn3.addActionListener(evt -> btn3ActionPerformed(evt));
btn2.setMinimumSize(new java.awt.Dimension(75, 25));
btn2.setPreferredSize(new java.awt.Dimension(150, 50));
btn2.addActionListener(evt -> btn2ActionPerformed(evt));
btn1.setMinimumSize(new java.awt.Dimension(75, 25));
btn1.setPreferredSize(new java.awt.Dimension(150, 50));
btn1.addActionListener(evt -> btn1ActionPerformed(evt));
代码示例来源:origin: magefree/mage
searchButton.setToolTipText("Search and select from list");
searchButton.setAlignmentX(1.0F);
searchButton.setMinimumSize(new java.awt.Dimension(24, 24));
searchButton.setPreferredSize(new java.awt.Dimension(32, 32));
searchButton.setMaximumSize(new java.awt.Dimension(32, 32));
代码示例来源:origin: magefree/mage
btClear.setMinimumSize(new java.awt.Dimension(30, 25));
btClear.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
代码示例来源:origin: magefree/mage
btnFindMain.setMargin(new java.awt.Insets(2, 2, 2, 2));
btnFindMain.setMaximumSize(new java.awt.Dimension(42, 23));
btnFindMain.setMinimumSize(new java.awt.Dimension(42, 23));
btnFindMain.setName("connectXmageDeBtn"); // NOI18N
btnFindMain.setPreferredSize(new java.awt.Dimension(23, 23));
代码示例来源:origin: magefree/mage
btnSetFastSearch.setToolTipText(FastSearchUtil.DEFAULT_EXPANSION_TOOLTIP_MESSAGE);
btnSetFastSearch.setAlignmentX(1.0F);
btnSetFastSearch.setMinimumSize(new java.awt.Dimension(24, 24));
btnSetFastSearch.setPreferredSize(new java.awt.Dimension(32, 32));
btnSetFastSearch.setMaximumSize(new java.awt.Dimension(32, 32));
代码示例来源:origin: magefree/mage
jButtonAddToMain.setMargin(null);
jButtonAddToMain.setMaximumSize(new java.awt.Dimension(35, 23));
jButtonAddToMain.setMinimumSize(new java.awt.Dimension(35, 23));
jButtonAddToMain.setPreferredSize(new java.awt.Dimension(30, 28));
jButtonAddToMain.addActionListener(new java.awt.event.ActionListener() {
jButtonRemoveFromMain.setMargin(null);
jButtonRemoveFromMain.setMaximumSize(new java.awt.Dimension(42, 23));
jButtonRemoveFromMain.setMinimumSize(new java.awt.Dimension(42, 23));
jButtonRemoveFromMain.setPreferredSize(new java.awt.Dimension(30, 28));
jButtonRemoveFromMain.addActionListener(new java.awt.event.ActionListener() {
jButtonAddToSideboard.setMargin(new java.awt.Insets(2, 0, 2, 0));
jButtonAddToSideboard.setMaximumSize(new java.awt.Dimension(100, 30));
jButtonAddToSideboard.setMinimumSize(new java.awt.Dimension(10, 30));
jButtonAddToSideboard.setPreferredSize(new java.awt.Dimension(30, 28));
jButtonAddToSideboard.addActionListener(new java.awt.event.ActionListener() {
jButtonRemoveFromSideboard.setMargin(new java.awt.Insets(2, 0, 2, 0));
jButtonRemoveFromSideboard.setMaximumSize(new java.awt.Dimension(10, 30));
jButtonRemoveFromSideboard.setMinimumSize(new java.awt.Dimension(100, 30));
jButtonRemoveFromSideboard.setPreferredSize(new java.awt.Dimension(30, 28));
jButtonRemoveFromSideboard.addActionListener(new java.awt.event.ActionListener() {
代码示例来源:origin: org.netbeans.api/org-openide-awt
int h = getOrientation() == HORIZONTAL ? getHeight() - getInsets().top - getInsets().bottom : overflowButton.getIcon().getIconHeight() + 4;
overflowButton.setMaximumSize(new Dimension(w, h));
overflowButton.setMinimumSize(new Dimension(w, h));
overflowButton.setPreferredSize(new Dimension(w, h));
代码示例来源:origin: winder/Universal-G-Code-Sender
saveButton.setEnabled(false);
saveButton.setMaximumSize(new java.awt.Dimension(88, 29));
saveButton.setMinimumSize(new java.awt.Dimension(88, 29));
saveButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
代码示例来源:origin: magefree/mage
saveButton.setMinimumSize(new java.awt.Dimension(100, 30));
saveButton.setPreferredSize(new java.awt.Dimension(100, 30));
saveButton.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
exitButton.setMinimumSize(new java.awt.Dimension(100, 30));
exitButton.setPreferredSize(new java.awt.Dimension(100, 30));
exitButton.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
代码示例来源:origin: org.scijava/scijava-ui-swing
public static JButton createButton16(final ImageIcon icon,
final String toolTip)
{
final JButton newButton = new JButton();
newButton.setMargin(new Insets(0, 0, 0, 0));
newButton.setMinimumSize(new Dimension(16, 16));
if (toolTip != null) {
newButton.setToolTipText(toolTip);
}
newButton.setIcon(icon);
return newButton;
}
代码示例来源:origin: net.imagej/ij-ui-swing
public static JButton createButton16(ImageIcon icon, String toolTip) {
JButton newButton = new JButton();
newButton.setMargin(new Insets(0, 0, 0, 0));
newButton.setMinimumSize(new Dimension(16, 16));
if (toolTip != null) {
newButton.setToolTipText(toolTip);
}
newButton.setIcon(icon);
return newButton;
}
代码示例来源:origin: UNIVALI-LITE/Portugol-Studio
private JButton createZeroButton() {
JButton jbutton = new JButton();
jbutton.setPreferredSize(new Dimension(0, 0));
jbutton.setMinimumSize(new Dimension(0, 0));
jbutton.setMaximumSize(new Dimension(0, 0));
return jbutton;
}
@Override
代码示例来源:origin: protegeproject/protege
private JButton createZeroSizeButton() {
JButton button = new JButton();
button.setMaximumSize(new Dimension(0, 0));
button.setPreferredSize(new Dimension(0, 0));
button.setMinimumSize(new Dimension(0, 0));
return button;
}
}
代码示例来源:origin: chatty/chatty
private void configureButton(JButton button, String icon, String tooltip) {
button.setIcon(new ImageIcon(ListSelector.class.getResource(icon)));
button.setToolTipText(tooltip);
button.setPreferredSize(BUTTON_SIZE);
button.setSize(BUTTON_SIZE);
button.setMaximumSize(BUTTON_SIZE);
button.setMinimumSize(BUTTON_SIZE);
}
内容来源于网络,如有侵权,请联系作者删除!