本文整理了Java中javax.swing.JWindow.getContentPane()
方法的一些代码示例,展示了JWindow.getContentPane()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JWindow.getContentPane()
方法的具体详情如下:
包路径:javax.swing.JWindow
类名称:JWindow
方法名:getContentPane
暂无
代码示例来源:origin: stackoverflow.com
autoSuggestionPopUpWindow.getContentPane().add(suggestionsPanel);
autoSuggestionPopUpWindow.setMinimumSize(new Dimension(textField.getWidth(), 30));
autoSuggestionPopUpWindow.setSize(tW, tH);
代码示例来源:origin: stackoverflow.com
if (j.getContentPane().getComponents().length > 0) {
throw new RuntimeException("ProgramCheck: Parent already contains content.");
j.getContentPane().add(basePanel);
((JWindow) parent).getContentPane().setBackground(jPanels.get(0).getBackground());
parent.remove(basePanel);
parent.validate();
代码示例来源:origin: net.java.dev.laf-widget/laf-widget
@Override
public void installComponents() {
this.previewWindow = new JWindow();
this.previewWindow.getContentPane().setLayout(new BorderLayout());
}
代码示例来源:origin: stackoverflow.com
JWindow w = (JWindow) Window.getWindows()[0];
JPanel p = (JPanel) w.getContentPane().getComponent(2);
JTextArea t = (JTextArea) p.getComponent(5);
String s = t.getText();
代码示例来源:origin: stackoverflow.com
import javax.swing.*;
import java.awt.*;
public class FrmSplash extends JWindow implements Runnable {
private static final long serialVersionUID = 1L;
public void run() {
JLabel SplashLabel = new JLabel(new ImageIcon("Image001.jpg"));
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
getContentPane().add(SplashLabel, BorderLayout.CENTER);
setSize((screen.width), (screen.height));
setVisible(true);
}
}
代码示例来源:origin: protegeproject/protege
private void createPopupWindow() {
JScrollPane sp = ComponentFactory.createScrollPane(popupList);
popupWindow = new JWindow((Window) SwingUtilities.getAncestorOfClass(Window.class, textComponent));
// popupWindow.setAlwaysOnTop(true); // this doesn't appear to work with certain Windows/java combinations
popupWindow.getContentPane().setLayout(new BorderLayout());
popupWindow.getContentPane().add(sp, BorderLayout.CENTER);
popupWindow.setFocusableWindowState(false);
}
代码示例来源:origin: edu.stanford.protege/org.protege.editor.owl
private void createPopupWindow() {
JScrollPane sp = ComponentFactory.createScrollPane(popupList);
popupWindow = new JWindow((Window) SwingUtilities.getAncestorOfClass(Window.class, textComponent));
// popupWindow.setAlwaysOnTop(true); // this doesn't appear to work with certain Windows/java combinations
popupWindow.getContentPane().setLayout(new BorderLayout());
popupWindow.getContentPane().add(sp, BorderLayout.CENTER);
popupWindow.setFocusableWindowState(false);
}
代码示例来源:origin: edu.stanford.protege/protege-editor-owl
private void createPopupWindow() {
JScrollPane sp = ComponentFactory.createScrollPane(popupList);
popupWindow = new JWindow((Window) SwingUtilities.getAncestorOfClass(Window.class, textComponent));
// popupWindow.setAlwaysOnTop(true); // this doesn't appear to work with certain Windows/java combinations
popupWindow.getContentPane().setLayout(new BorderLayout());
popupWindow.getContentPane().add(sp, BorderLayout.CENTER);
popupWindow.setFocusableWindowState(false);
}
代码示例来源:origin: org.protege/protege-editor-owl
private void createPopupWindow() {
JScrollPane sp = ComponentFactory.createScrollPane(popupList);
popupWindow = new JWindow((Window) SwingUtilities.getAncestorOfClass(Window.class, textComponent));
// popupWindow.setAlwaysOnTop(true); // this doesn't appear to work with certain Windows/java combinations
popupWindow.getContentPane().setLayout(new BorderLayout());
popupWindow.getContentPane().add(sp, BorderLayout.CENTER);
popupWindow.setFocusableWindowState(false);
}
代码示例来源:origin: cpesch/RouteConverter
public void initialize(AwtGraphicMapView mapView, MapViewCallback mapViewCallback) {
this.mapView = mapView;
this.mapViewCallback = mapViewCallback;
window = new JWindow(getFrame());
JPanel contentPane = (JPanel) window.getContentPane();
contentPane.add(label);
contentPane.setBackground(new Color(255, 255, 204));
contentPane.setBorder(new CompoundBorder(createEtchedBorder(), new EmptyBorder(2, 3, 2, 3)));
label.setFont(label.getFont().deriveFont(9f));
mapView.addMouseListener(this);
mapView.addMouseMotionListener(this);
}
代码示例来源:origin: cytoscape/application
/**
* DOCUMENT ME!
*/
public static void hideSplash() {
if ((splashWindow != null) && splashWindow.isVisible()) {
splashWindow.setVisible(false);
if (splashContent != null) {
splashWindow.getContentPane().remove(splashContent);
splashContent = null;
}
}
}
}
代码示例来源:origin: com.eas.platypus/platypus-js-calendar-widget
private void createCalendarWindow(Window aAncestor) {
if (aAncestor != null) {
_calendarWindow = new JCalendarPopupWindow(aAncestor);
} else {
_calendarWindow = new JCalendarPopupWindow();
}
JPanel contentPanel = (JPanel) _calendarWindow.getContentPane();
contentPanel.setLayout(new BorderLayout());
contentPanel.add(_calendarPanel, BorderLayout.CENTER);
_calendarWindow.pack();
}
代码示例来源:origin: net.sf.ingenias/editor
public static Dimension getSize(String classname, ingenias.editor.entities.ViewPreferences.ViewType kind){
synchronized (renderer) {
helperFrame.getContentPane().removeAll();
if (retrievePanel(classname,kind)==null){
throw new RuntimeException("Error: there is no renderer defined for \""+classname+"\" for the notation "+kind+". Existing renderers are :"+renderer.keySet());
}
helperFrame.getContentPane().add((JPanel)retrievePanel(classname,kind));
helperFrame.pack();
}
return helperFrame.getSize();
}
代码示例来源:origin: google/sagetv
private static void splash()
{
splashWindow = new javax.swing.JWindow();
splashWindow.getContentPane().setLayout(new java.awt.BorderLayout());
java.awt.Image theImage = java.awt.Toolkit.getDefaultToolkit().createImage(MiniClient.class.getClassLoader().getResource("images/splash.gif"));
GFXCMD2.ensureImageIsLoaded(theImage);
javax.swing.JLabel splashImage = new javax.swing.JLabel(new javax.swing.ImageIcon(theImage));
splashWindow.getContentPane().add(splashImage, "Center");
java.awt.Dimension scrSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
splashWindow.pack();
java.awt.Point center = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getCenterPoint();
splashWindow.setLocation(center.x - splashWindow.getWidth()/2, center.y - splashWindow.getHeight()/2);
splashWindow.setVisible(true);
}
代码示例来源:origin: stackoverflow.com
JWindow window = new JWindow();
window.getContentPane().add(
new JLabel("", new ImageIcon(new URL("http://docs.oracle.com/javase/tutorial/uiswing/examples/misc/SplashDemoProject/src/misc/images/splash.gif")), SwingConstants.CENTER));
window.setBounds(500, 150, 300, 200);
window.setVisible(true);
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
window.setVisible(false);
JFrame frame = new JFrame();
frame.add(new JLabel("Welcome"));
frame.setVisible(true);
frame.setSize(300,100);
window.dispose();
代码示例来源:origin: stackoverflow.com
mediaPlayerComponent = new EmbeddedMediaPlayerComponent() {
@Override
protected Window onGetOverlay() {
final JWindow transparentWindow = new JWindow();
// Set basic window opacity if required - the window system must support WindowTranslucency (i.e. PERPIXEL_TRANSLUCENT)!
transparentWindow.setOpacity(0.8f);
// White with transparent alpha channel - WindowTranslucency is required for translucency.
transparentWindow.setBackground(new Color(1.0f, 1.0f, 1.0f, 0.0f));
final JLabel superImposedLightweigtLabel = new JLabel("Hello, VLC.", JLabel.CENTER);
superImposedLightweigtLabel.setOpaque(false);
transparentWindow.getContentPane().add(superImposedLightweigtLabel);
return transparentWindow;
}
...
}
代码示例来源:origin: net.sf.ingenias/editor
public void run() {
JLabel jl = new JLabel(message);
jl.setFont(new java.awt.Font("Dialog", 1, 36));
jw.getContentPane().add(jl);
jw.pack();
jw.setLocation(getCenter(jw.getSize(),resources.getMainFrame()));
jw.setVisible(true);
}
});
代码示例来源:origin: stackoverflow.com
JWindow subFrame = new JWindow();
subFrame.setBounds(0, 0, 500, 500);
subFrame.setAlwaysOnTop(true);
subFrame.setOpacity(0.50f);
subFrame.setBackground(new Color(1.0f, 1.0f, 1.0f, 0.05f));
JButton button = new JButton("Hello");
button.setBounds(20, 180, 100, 40);
subFrame.getContentPane().setLayout(null);
subFrame.getContentPane().add(button);
subFrame.setVisible(true);
代码示例来源:origin: de.uni_leipzig.asv.toolbox/toolbox-utils
/**
* Show the splash screen while the rest of the program loads
*/
public void createSplashScreen() {
JLabel splashLabel = new JLabel(createImageIcon("Splash3.jpg"));
this.splashScreen = new JWindow();
this.splashScreen.getContentPane().add(splashLabel);
this.splashScreen.pack();
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
this.splashScreen.setLocation(screenSize.width / 2
- this.splashScreen.getSize().width / 2, screenSize.height / 2
- this.splashScreen.getSize().height / 2);
}
代码示例来源:origin: org.gephi/ui-components
public void showPopupPane() {
if (pane == null) {
pane = new JPopupPaneComponent();
}
if (popupWindow == null) {
popupWindow = new JWindow(WindowManager.getDefault().getMainWindow());
}
popupWindow.getContentPane().add(pane);
showingPopup = true;
Toolkit.getDefaultToolkit().addAWTEventListener(hideListener, AWTEvent.MOUSE_EVENT_MASK);
WindowManager.getDefault().getMainWindow().addWindowStateListener(hideListener);
WindowManager.getDefault().getMainWindow().addComponentListener(hideListener);
resizePopup();
popupWindow.setVisible(true);
pane.requestFocus();
}
内容来源于网络,如有侵权,请联系作者删除!