/** * Updates the font metrics the first time we're displayed. */ @Override public void addNotify() { super.addNotify(); // Some LookAndFeels (e.g. WebLaF) for some reason have a 0x0 parent // window initially (perhaps something to do with them fading in?), // which will cause an exception from getGraphics(), so we must be // careful here. if (metricsNeverRefreshed) { Window parent = SwingUtilities.getWindowAncestor(this); if (parent!=null && parent.getWidth()>0 && parent.getHeight()>0) { refreshFontMetrics(getGraphics2D(getGraphics())); metricsNeverRefreshed = false; } } // Re-start parsing if we were removed from one container and added // to another if (parserManager!=null) { parserManager.restartParsing(); } }
/** * Updates the font metrics the first time we're displayed. */ public void addNotify() { super.addNotify(); // We know we've just been connected to a screen resource (by // definition), so initialize our font metrics objects. refreshFontMetrics(getGraphics2D(getGraphics())); }
/** * Updates the font metrics the first time we're displayed. */ public void addNotify() { super.addNotify(); // We know we've just been connected to a screen resource (by // definition), so initialize our font metrics objects. refreshFontMetrics(getGraphics2D(getGraphics())); // Re-start parsing if we were removed from one container and added // to another if (parserManager!=null) { parserManager.restartParsing(); } }
/** * Updates the font metrics the first time we're displayed. */ @Override public void addNotify() { super.addNotify(); // Some LookAndFeels (e.g. WebLaF) for some reason have a 0x0 parent // window initially (perhaps something to do with them fading in?), // which will cause an exception from getGraphics(), so we must be // careful here. if (metricsNeverRefreshed) { Window parent = SwingUtilities.getWindowAncestor(this); if (parent!=null && parent.getWidth()>0 && parent.getHeight()>0) { refreshFontMetrics(getGraphics2D(getGraphics())); metricsNeverRefreshed = false; } } // Re-start parsing if we were removed from one container and added // to another if (parserManager!=null) { parserManager.restartParsing(); } }