本文整理了Java中javax.swing.JWindow.setContentPane()
方法的一些代码示例,展示了JWindow.setContentPane()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JWindow.setContentPane()
方法的具体详情如下:
包路径:javax.swing.JWindow
类名称:JWindow
方法名:setContentPane
暂无
代码示例来源:origin: stackoverflow.com
frame.setContentPane(new TranslucentPane());
frame.add(new JLabel(new ImageIcon(ImageIO.read(getClass().getResource("/Puppy.png")))));
frame.pack();
代码示例来源:origin: stackoverflow.com
public class Spot {
public static void main(final String... args) throws IOException {
JWindow f = new JWindow();
f.setContentPane(new JLabel(new ImageIcon(ImageIO.read(new URL(
"http://i.stack.imgur.com/IPgpQ.png")))));
f.pack();
f.setVisible(true);
}
}
代码示例来源:origin: com.fifesoft.rtext/fife.common
/**
* Removes any listeners from the "old" parent window when this text
* field is removed from a view hierarchy.
*/
private void cleanupOldParentWindow() {
// Get rid of old popup window if it exists. We must create a new
// one, as if the user has called discoverParentWindow(), they
// have probably re-parented this text field, so we must in turn
// "re-parent" our popup.
if (popupWindow!=null) {
//popupWindow.remove(contentPane);
popupWindow.setContentPane(new JPanel());
popupWindow.dispose();
popupWindow = null;
}
if (parent!=null) {
parent.removeComponentListener(this);
parent = null;
}
}
代码示例来源:origin: protegeproject/protege
private JWindow getWindow() {
if (window == null) {
Window w = (Window) SwingUtilities.getAncestorOfClass(Window.class, parent);
window = new JWindow(w);
window.setFocusableWindowState(false);
JPanel popupContent = new JPanel(new BorderLayout(3, 3));
popupContent.add(searchPanel);
window.setContentPane(popupContent);
addFocusListener(new FocusAdapter() {
public void focusLost(FocusEvent e) {
window.setVisible(false);
}
});
SwingUtilities.getRoot(this).addComponentListener(new ComponentAdapter() {
public void componentMoved(ComponentEvent e) {
closeResults();
}
});
}
return window;
}
代码示例来源:origin: stackoverflow.com
private Window initFullScreenWindow() {
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice[] gds = ge.getScreenDevices();
GraphicsDevice gd = gds[1];
JWindow window = new JWindow(gd.getDefaultConfiguration());
window.setContentPane(getJFSPanel());
window.setLocation(1280, 0);
window.setSize(gd.getDisplayMode().getWidth(), gd.getDisplayMode().getHeight());
window.setAlwaysOnTop(true);
//gd.setFullScreenWindow(window);
return window;
}
代码示例来源:origin: edu.stanford.protege/org.protege.editor.owl
private JWindow getWindow() {
if (window == null) {
Window w = (Window) SwingUtilities.getAncestorOfClass(Window.class, parent);
window = new JWindow(w);
window.setFocusableWindowState(false);
JPanel popupContent = new JPanel(new BorderLayout(3, 3));
popupContent.add(searchPanel);
window.setContentPane(popupContent);
addFocusListener(new FocusAdapter() {
public void focusLost(FocusEvent e) {
window.setVisible(false);
}
});
SwingUtilities.getRoot(this).addComponentListener(new ComponentAdapter() {
public void componentMoved(ComponentEvent e) {
closeResults();
}
});
}
return window;
}
代码示例来源:origin: com.fifesoft/autocomplete
tooltip.setContentPane(panel);
代码示例来源:origin: edu.stanford.protege/protege-editor-owl
private JWindow getWindow() {
if (window == null) {
Window w = (Window) SwingUtilities.getAncestorOfClass(Window.class, parent);
window = new JWindow(w);
window.setFocusableWindowState(false);
JPanel popupContent = new JPanel(new BorderLayout(3, 3));
popupContent.add(searchPanel);
window.setContentPane(popupContent);
addFocusListener(new FocusAdapter() {
public void focusLost(FocusEvent e) {
window.setVisible(false);
}
});
SwingUtilities.getRoot(this).addComponentListener(new ComponentAdapter() {
public void componentMoved(ComponentEvent e) {
closeResults();
}
});
}
return window;
}
代码示例来源:origin: com.fifesoft.rtext/fife.common
/**
* Creates the popup window for this text field.
*
* @return The popup window.
*/
private JWindow createPopupWindow() {
//System.err.println("... Creating a new popupWindow!");
JWindow popupWindow = new JWindow(parent);
popupWindow.setFocusableWindowState(false);
popupWindow.setContentPane(contentPane);
popupWindow.applyComponentOrientation(getComponentOrientation());
return popupWindow;
}
代码示例来源:origin: stackoverflow.com
newWin.setContentPane(panel);
newWin.pack();
代码示例来源:origin: stackoverflow.com
frame.setContentPane(new ShapedPane());
frame.pack();
frame.setLocationRelativeTo(null);
代码示例来源:origin: stackoverflow.com
frame.setContentPane(new LeafPane());
frame.pack();
frame.setLocationRelativeTo(null);
代码示例来源:origin: stackoverflow.com
frame.setBackground(new Color(0, 0, 0, 0));
TranslucentPane tp = new TranslucentPane(text, composite, points);
frame.setContentPane(tp);
frame.pack();
frame.setLocationRelativeTo(null);
代码示例来源:origin: stackoverflow.com
frame.setContentPane(new TranslucentPane());
frame.add(new JLabel(new ImageIcon(ImageIO.read(getClass().getResource("/124742-high-school-collection/png/image_4.png")))));
frame.pack();
代码示例来源:origin: stackoverflow.com
contentPane.add(updateLabel, BorderLayout.CENTER);
contentPane.add(positionLabel, BorderLayout.PAGE_END);
window.setContentPane(contentPane);
window.setOpacity(0.5f);
window.setSize(200, 100);
代码示例来源:origin: stackoverflow.com
JLabel content = new JLabel(new ImageIcon(ImageIO.read(...))));
content.setLayout(new GridBagLayout());
splash.setContentPane(content);
代码示例来源:origin: org.protege/protege-editor-owl
private JWindow getWindow() {
if (window == null) {
Window w = (Window) SwingUtilities.getAncestorOfClass(Window.class, parent);
window = new JWindow(w);
window.setFocusableWindowState(false);
JScrollPane sp = ComponentFactory.createScrollPane(resultsList);
sp.setBorder(null);
window.setContentPane(sp);
addFocusListener(new FocusAdapter() {
public void focusLost(FocusEvent e) {
window.setVisible(false);
resultsList.setListData(new Object []{});
}
});
SwingUtilities.getRoot(this).addComponentListener(new ComponentAdapter() {
public void componentMoved(ComponentEvent e) {
closeResults();
}
});
}
return window;
}
代码示例来源:origin: stackoverflow.com
dialog.setFocusable(true);
dialog.setLocation(x, y);
dialog.setContentPane(component);
component.setBorder(new JPopupMenu().getBorder());
dialog.setSize(component.getPreferredSize());
代码示例来源:origin: stackoverflow.com
window.setAlwaysOnTop(true);
JPanel panel = singleColorPanel(Color.red);
window.setContentPane(panel);
revalidate(window);
final new Robot robot;
代码示例来源:origin: raydac/netbeans-mmd-plugin
window.setAlwaysOnTop(true);
window.setAutoRequestFocus(true);
window.setContentPane(selectedEditor.getContainerToShow());
内容来源于网络,如有侵权,请联系作者删除!