本文整理了Java中java.awt.Container.getHeight()
方法的一些代码示例,展示了Container.getHeight()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Container.getHeight()
方法的具体详情如下:
包路径:java.awt.Container
类名称:Container
方法名:getHeight
暂无
代码示例来源:origin: runelite/runelite
int parentWidth = canvasParent.getWidth();
int parentHeight = canvasParent.getHeight();
代码示例来源:origin: runelite/runelite
final double sw = (1.0 * parent.getWidth()) / pd.width;
final double sh = (1.0 * parent.getHeight()) / pd.height;
代码示例来源:origin: runelite/runelite
int parentWidth = canvasParent.getWidth();
int parentHeight = canvasParent.getHeight();
代码示例来源:origin: stackoverflow.com
Container c = getContentPane();
BufferedImage im = new BufferedImage(c.getWidth(), c.getHeight(), BufferedImage.TYPE_INT_ARGB);
c.paint(im.getGraphics());
ImageIO.write(im, "PNG", new File("shot.png"));
代码示例来源:origin: nodebox/nodebox
public void takeScreenshot(File outputFile) {
Container c = getContentPane();
BufferedImage img = new BufferedImage(c.getWidth(), c.getHeight(), BufferedImage.TYPE_INT_RGB);
Graphics2D g2 = img.createGraphics();
c.paint(g2);
try {
ImageIO.write(img, "png", outputFile);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
代码示例来源:origin: ron190/jsql-injection
int layeredPaneWidth = layeredPane.getWidth();
int layeredPaneHeight = layeredPane.getHeight();
代码示例来源:origin: it.tidalwave.netbeans/it-tidalwave-netbeans-swing
@Override @Nonnull
public Dimension preferredLayoutSize (final @Nonnull Container container)
{
return new Dimension((int)(container.getWidth() * (1 - leftSpring - rightSpring)),
(int)(container.getHeight() * (1 - topSpring - bottomSpring)));
}
代码示例来源:origin: it.tidalwave.netbeans/it-tidalwave-netbeans-swing
public void layoutContainer (final Container container)
{
final int width = container.getWidth();
final int height = container.getHeight();
for (int i = 0; i < container.getComponentCount(); i++)
{
final Component component = container.getComponent(i);
component.setBounds(0, 0, width, height);
}
}
}
代码示例来源:origin: org.geotools/gt-widgets-swing-pending
public void layoutContainer(Container parent) {
int maxWidth = parent.getWidth();
int maxHeight = parent.getHeight();
int nComps = parent.getComponentCount();
for (int i = 0 ; i < nComps ; i++) {
Component c = parent.getComponent(i);
c.setBounds(0, 0, maxWidth,maxHeight);
}
}
代码示例来源:origin: net.anwiba.commons/anwiba-commons-swing-core
@Override
public void layoutContainer(final Container target) {
int counter = 0;
final int width = target.getWidth();
final int height = target.getHeight() / this.numberOfRows;
for (final Component c : target.getComponents()) {
c.setBounds(0, height * counter++, width, height);
if (c instanceof JComponent) {
((JComponent) c).setBorder(BorderFactory.createLineBorder(this.borderColor, 1));
}
}
}
代码示例来源:origin: org.netbeans.api/org-openide-explorer
@Override
public void layoutContainer( Container parent ) {
super.layoutContainer(parent);
if( null != searchPanel && searchPanel.isVisible() ) {
Insets innerInsets = getInnerInsets();
Dimension prefSize = searchPanel.getPreferredSize();
searchPanel.setBounds(innerInsets.left, parent.getHeight()-innerInsets.bottom-prefSize.height,
parent.getWidth()-innerInsets.left-innerInsets.right, prefSize.height);
}
}
}
代码示例来源:origin: org.netbeans.api/org-openide-explorer
@Override
public void layoutContainer( Container parent ) {
super.layoutContainer(parent);
if( null != searchpanel && searchpanel.isVisible() ) {
Insets innerInsets = getInnerInsets();
Dimension prefSize = searchpanel.getPreferredSize();
searchpanel.setBounds(innerInsets.left, parent.getHeight()-innerInsets.bottom-prefSize.height,
parent.getWidth()-innerInsets.left-innerInsets.right, prefSize.height);
}
}
代码示例来源:origin: stackoverflow.com
Container pane = frame.getContentPane();
BufferedImage img = new BufferedImage(pane.getWidth(), pane.getHeight(), BufferedImage.TYPE_INT_RGB);
Graphics2D g2d = img.createGraphics();
pane.printAll(g2d);
g2d.dispose();
try {
ImageIO.write(img, "png", new File("save.png"));
} catch (IOException ex) {
ex.printStackTrace();
}
代码示例来源:origin: google/sagetv
public void layoutContainer(java.awt.Container parent)
{
c.setBounds(parent.getInsets().left, parent.getInsets().top, parent.getWidth() - parent.getInsets().left - parent.getInsets().right,
parent.getHeight() - parent.getInsets().top - parent.getInsets().bottom);
//System.out.println("LAYOUT frame bounds=" + f.getBounds() + " videoBounds=" + videoBounds + " parentBounds=" + parent.getBounds());
}
};
代码示例来源:origin: com.github.insubstantial/flamingo
@Override
public Dimension preferredLayoutSize(Container c) {
if (scrollablePanel.getScrollType() == ScrollType.HORIZONTALLY) {
return new Dimension(c.getWidth(), 21);
} else {
return new Dimension(21, c.getHeight());
}
}
代码示例来源:origin: google/sagetv
public void layoutContainer(java.awt.Container parent)
{
c.setBounds(parent.getInsets().left, parent.getInsets().top, parent.getWidth() - parent.getInsets().left - parent.getInsets().right,
parent.getHeight() - parent.getInsets().top - parent.getInsets().bottom);
// videoCanvas.setBounds(parent.getInsets().left, parent.getInsets().top,
// parent.getWidth() - parent.getInsets().left - parent.getInsets().right,
// parent.getHeight() - parent.getInsets().top - parent.getInsets().bottom);//vf.setBounds(x, y, w, h);
//System.out.println("LAYOUT frame bounds=" + f.getBounds() + " videoBounds=" + videoBounds + " parentBounds=" + parent.getBounds());
}
};
代码示例来源:origin: google/sagetv
public void layoutContainer(java.awt.Container parent)
{
c.setBounds(parent.getInsets().left, parent.getInsets().top, parent.getWidth() - parent.getInsets().left - parent.getInsets().right,
parent.getHeight() - parent.getInsets().top - parent.getInsets().bottom);
//System.out.println("LAYOUT frame bounds=" + f.getBounds() + " videoBounds=" + videoBounds + " parentBounds=" + parent.getBounds());
}
};
代码示例来源:origin: com.github.insubstantial/substance
@Override
public void layoutContainer(Container parent) {
Dimension fpp = fixedPanel.getPreferredSize();
int dx = (parent.getWidth() - fpp.width) / 2;
int dy = (parent.getHeight() - fpp.height) / 2;
fixedPanel.setBounds(dx, dy, fpp.width, fpp.height);
}
代码示例来源:origin: com.github.insubstantial/flamingo
@Override
public void layoutContainer(Container c) {
int width = c.getWidth();
int height = c.getHeight();
scrollerPanel.setBounds(0, 0, width, height);
}
}
代码示例来源:origin: com.github.insubstantial/flamingo
@Override
public void layoutContainer(Container parent) {
Insets insets = parent.getInsets();
int left = insets.left;
int right = insets.right;
int top = insets.top;
int bottom = insets.bottom;
scroll.setBounds(left, top, parent.getWidth() - left - right,
parent.getHeight() - top - bottom);
}
内容来源于网络,如有侵权,请联系作者删除!