本文整理了Java中javax.swing.JPanel.setSize()
方法的一些代码示例,展示了JPanel.setSize()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JPanel.setSize()
方法的具体详情如下:
包路径:javax.swing.JPanel
类名称:JPanel
方法名:setSize
暂无
代码示例来源:origin: chewiebug/GCViewer
public void setSize(int width, int height) {
super.setSize(width, height);
configureFormatter();
}
代码示例来源:origin: RipMeApp/ripme
emptyPanel.setSize(0, 0);
代码示例来源:origin: magefree/mage
public void setSize(int width, int height) {
this.currentWidth = width;
this.currentHeight = height;
if (arrowsManagerPanel != null) {
arrowsManagerPanel.setSize(width, height);
}
for (JPanel arrowPanel : arrowPanels.values()) {
arrowPanel.setSize(width, height);
arrowPanel.repaint();
}
}
代码示例来源:origin: magefree/mage
private JPanel getArrowsPanel(UUID gameId) {
if (!arrowPanels.containsKey(gameId)) {
JPanel arrowPanel = new JPanel();
arrowPanel.setVisible(true);
arrowPanel.setOpaque(false);
arrowPanel.setLayout(null);
arrowPanel.setSize(currentWidth, currentHeight);
arrowPanels.put(gameId, arrowPanel);
getArrowsManagerPanel().add(arrowPanel);
return arrowPanel;
}
return arrowPanels.get(gameId);
}
代码示例来源:origin: nodebox/nodebox
private void updateExamplesPanelSize() {
Component scrollPane = examplesPanel.getParent();
int scrollPaneWidth = scrollPane.getWidth();
ExampleLayout exampleLayout = (ExampleLayout) examplesPanel.getLayout();
int contentsHeight = exampleLayout.calculateHeight(examplesPanel, scrollPaneWidth);
examplesPanel.setSize(scrollPaneWidth, contentsHeight);
}
代码示例来源:origin: magefree/mage
@Override
public void componentResized(ComponentEvent e) {
int width = ((JComponent) e.getSource()).getWidth();
int height = ((JComponent) e.getSource()).getHeight();
jLayeredBackgroundPane.setSize(width, height);
jSplitPane0.setSize(width, height);
if (height < storedHeight) {
pnlBattlefield.setSize(0, 200);
}
storedHeight = height;
sizeToScreen();
if (!initialized) {
String state = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_BIG_CARD_TOGGLED, null);
if (state != null && state.equals("down")) {
jSplitPane0.setDividerLocation(1.0);
}
initialized = true;
}
}
});
代码示例来源:origin: magefree/mage
@Override
public void doLayout() {
// Position transform and show source buttons
buttonPanel.setLocation(cardXOffset, cardYOffset);
buttonPanel.setSize(cardWidth, cardHeight);
int x = cardWidth / 20;
int y = cardHeight / 10;
if (dayNightButton != null) {
dayNightButton.setLocation(x, y);
y += 25;
y += 5;
}
if (showCopySourceButton != null) {
showCopySourceButton.setLocation(x, y);
}
}
代码示例来源:origin: nodebox/nodebox
topPanel.setPreferredSize(d);
topPanel.setMaximumSize(d);
topPanel.setSize(d);
topPanel.add(colorField, BorderLayout.WEST);
hexPanel.setPreferredSize(d);
hexPanel.setMaximumSize(d);
hexPanel.setSize(d);
hexField = new JTextField();
hexField.setFont(Theme.SMALL_BOLD_FONT);
bottomPanel.setPreferredSize(d);
bottomPanel.setMaximumSize(d);
bottomPanel.setSize(d);
bottomPanel.add(Box.createHorizontalStrut(77));
bottomPanel.add(rangeBox);
代码示例来源:origin: magefree/mage
zonesPanel.setSize(100, 60);
zonesPanel.setLayout(null);
zonesPanel.setOpaque(false);
energyExperiencePanel.setSize(100, 20);
energyExperiencePanel.setLayout(null);
energyExperiencePanel.setOpaque(false);
代码示例来源:origin: fossasia/neurolab-desktop
this.trackPanel.setSize(frameWidth, frameHeight);
JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, this.trackPanel, toolsPanel);
splitPane.setDividerLocation(border + trackHeight / 2);
displaySettingsPanel.setSize(80, frameHeight);
displaySettingsPanel.setBorder(BorderFactory.createTitledBorder("display settings"));
displaySettingsPanel.setLayout(new BorderLayout());
代码示例来源:origin: com.synaptix/SynaptixSwing
public void setSize(int w, int h) {
super.setSize(w, h);
width = w;
height = h;
}
代码示例来源:origin: stackoverflow.com
private void addContentPanel()
{
JPanel p = new JPanel();
p.setLayout(new BorderLayout());
p.setSize(new Dimension(800, 600));
this.setContentPane(p);
}
代码示例来源:origin: matsim-org/matsim
@Override
public JComponent getOptionsGUI(JComponent mother) {
JPanel com = new JPanel();
com.setSize(500, 60);
JCheckBox synchBox = new JCheckBox(INCLUDE_ROUTES);
synchBox.setSelected(true);
synchBox.addItemListener(this);
com.add(synchBox);
return com;
}
代码示例来源:origin: magefree/mage
iconPanel.setSize(realCardSize.width, realCardSize.height);
counterPanel.setSize(realCardSize.width, realCardSize.height);
int size = cardWidth > WIDTH_LIMIT ? 40 : 20;
代码示例来源:origin: openimaj/openimaj
/**
* Default constructor
*/
public TrackerInfo() {
super.setLayout(new GridBagLayout());
super.setPreferredSize(new Dimension(600, 300));
super.setSize(600, 300);
init();
}
代码示例来源:origin: openimaj/openimaj
/**
* Default constructor
*/
public TrackerInfo() {
super.setLayout(new GridBagLayout());
super.setPreferredSize(new Dimension(600, 300));
super.setSize(600, 300);
this.init();
}
代码示例来源:origin: org.openimaj/demos
/**
* Default constructor
*/
public TrackerInfo() {
super.setLayout(new GridBagLayout());
super.setPreferredSize(new Dimension(600, 300));
super.setSize(600, 300);
init();
}
代码示例来源:origin: stackoverflow.com
JPanel p1 = new JPanel(new BoxLayout(p1, BoxLayout.X_AXIS));
JPanel p2 = new JPanel(new BoxLayout(p2, BoxLayout.Y_AXIS));
JLayeredPane lp = new JLayeredPane();
lp.add(p1, 1);
lp.add(p2, 0);
p1.setSize(lp.getPreferredSize());
p2.setSize(lp.getPreferredSize());
代码示例来源:origin: Multibit-Legacy/multibit-hd
@Override
public JPanel newComponentPanel() {
panel = Panels.newRoundedPanel();
panelCloseButton = Buttons.newPanelCloseButton(getClosePopoverAction());
panel.add(panelCloseButton, "aligny top, alignx right,shrink,wrap");
panel.add(Panels.newLanguageChange(), "align center,grow,wrap");
// Set size
panel.setSize(MultiBitUI.POPOVER_PREF_WIDTH, MultiBitUI.POPOVER_PREF_HEIGHT);
return panel;
}
代码示例来源:origin: freeplane/freeplane
@Override
public void setSize(final int width, final int height) {
final boolean sizeChanged = getWidth() != width || getHeight() != height;
if(sizeChanged) {
super.setSize(width, height);
validate();
}
}
内容来源于网络,如有侵权,请联系作者删除!