本文整理匯總了Java中javax.swing.JFrame.getGlassPane方法的典型用法代碼示例。如果您正苦於以下問題:Java JFrame.getGlassPane方法的具體用法?Java JFrame.getGlassPane怎麽用?Java JFrame.getGlassPane使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.JFrame
的用法示例。
在下文中一共展示了JFrame.getGlassPane方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: start
import javax.swing.JFrame; //導入方法依賴的package包/類
private void start() {
Toolkit.getDefaultToolkit().addAWTEventListener( this, KeyEvent.KEY_EVENT_MASK );
TopComponent.getRegistry().addPropertyChangeListener( this );
Window w = SwingUtilities.getWindowAncestor( resizingComponent );
if( w instanceof JFrame ) {
frame = ( JFrame ) w;
oldGlass = frame.getGlassPane();
glass = new GlassPane( resizingComponent );
frame.setGlassPane( glass );
glass.setVisible( true );
glass.invalidate();
glass.revalidate();
glass.repaint();
glass.refresh();
}
}
示例2: install
import javax.swing.JFrame; //導入方法依賴的package包/類
public void install() {
JFrame frame = (JFrame) WindowManagerImpl.getInstance().getMainWindow();
oldGlass = frame.getGlassPane();
if( oldGlass instanceof PleaseWait )
oldGlass = null;
frame.setGlassPane( this );
setVisible(true);
invalidate();
revalidate();
repaint();
}
示例3: run
import javax.swing.JFrame; //導入方法依賴的package包/類
@Override
public void run() {
try {
JFrame f = (JFrame)WindowManager.getDefault ().getMainWindow ();
Component c = f.getGlassPane ();
c.setVisible ( show );
c.setCursor (show ? Cursor.getPredefinedCursor (Cursor.WAIT_CURSOR) : null);
}
catch (NullPointerException npe) {
Exceptions.printStackTrace(npe);
}
}
示例4: run
import javax.swing.JFrame; //導入方法依賴的package包/類
public void run() {
try {
JFrame f = (JFrame) WindowManager.getDefault().getMainWindow();
Component c = f.getGlassPane();
c.setVisible(show);
c.setCursor(show ? Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR) : null);
} catch (NullPointerException npe) {
Exceptions.printStackTrace(npe);
}
}