JFrame component = new JFrame("My Frame"); component.addComponentListener(new ComponentAdapter() { public void componentResized(ComponentEvent evt) { Component c = (Component)evt.getSource(); //........ } });
@Override public void componentResized(ComponentEvent e) { JFrame tmp = (JFrame) e.getSource(); if (tmp.getWidth() < 600 || tmp.getHeight() < 700) { tmp.setSize(600, 700); } } });
@Override public void componentResized(ComponentEvent e) { Component source = (Component) e.getSource(); resizeMe(source.getWidth(), source.getHeight()); } });
@Override public void componentResized(ComponentEvent e) { int width = ((JComponent) e.getSource()).getWidth(); int height = ((JComponent) e.getSource()).getHeight(); SettingsManager.instance.setScreenWidthAndHeight(width, height); if (!liteMode && !grayMode) { backgroundPane.setSize(width, height); } updateCurrentFrameSize(); ArrowBuilder.getBuilder().setSize(width, height); if (title != null) { title.setBounds((int) (width - titleRectangle.getWidth()) / 2, (int) (height - titleRectangle.getHeight()) / 2, titleRectangle.width, titleRectangle.height); } } });
@Override public void componentResized(ComponentEvent e) { int width = ((JComponent) e.getSource()).getWidth(); int height = ((JComponent) e.getSource()).getHeight(); jLayeredBackgroundPane.setSize(width, height); jSplitPane0.setSize(width, height); if (height < storedHeight) { pnlBattlefield.setSize(0, 200); } storedHeight = height; sizeToScreen(); if (!initialized) { String state = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_BIG_CARD_TOGGLED, null); if (state != null && state.equals("down")) { jSplitPane0.setDividerLocation(1.0); } initialized = true; } } });
public void componentResized(ComponentEvent e) { if (e.getSource() == getBattleViewPanel()) { battleViewPanelResized(); } }
combo.addComponentListener( new ComponentAdapter() { public void componentResized( ComponentEvent e ) { Component component = (Component)e.getSource(); System.out.println( "Resized: " + component.getSize() ); } });
public void componentResized(ComponentEvent e) { Component c = (Component) e.getSource(); width = c.getWidth(); height = c.getHeight(); }
public void componentShown(ComponentEvent e) { Component c = (Component) e.getSource(); width = c.getWidth(); height = c.getHeight(); }
myComponent.addComponentListener(new ComponentAdapter() { @Override public void componentShown(ComponentEvent cEvt) { Component src = (Component) cEvt.getSource(); src.requestFocusInWindow(); } });
@Override public void componentShown(ComponentEvent e) { Object source = e.getSource(); if (!(source instanceof Window)) { return; } windows.markAsShowing((Window) source); }
public void componentShown(ComponentEvent e) { // Called when the window is made visible if(e.getSource()==window) { // Set initial divider's location updateDividerLocation(); } }
public void componentShown(ComponentEvent e) { scheduleRepaint(((Component) e.getSource()).getSize()); } }
public void componentMoved(ComponentEvent evt) { Component c = (Component)evt.getSource(); Point currentLocationOnScreen=c.getLocationOnScreen(); // do your requirements here with the variables currentLocationOnScreen and originLocation // update the originLocation variable for next occurrences of this method originLocation=currentLocationOnScreen; }
/** * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent) */ public void componentResized(ComponentEvent e) { update(e.getSource()); }
@Override public void componentResized(ComponentEvent e) { JFrame tmp = (JFrame) e.getSource(); if (tmp.getWidth() < 600 || tmp.getHeight() < 700) { tmp.setSize(600, 700); } } });
@Override public void componentResized(ComponentEvent e) { calculateGeometry(); Component c = (Component) e.getSource(); c.repaint(); }
@Override public void componentHidden(ComponentEvent e) { if (DEBUG) { System.err.println(e); } if (e.getSource() == canvas) { canvas.sendEventToBehaviorScheduler(e); } canvas.evaluateVisiblilty(); }
@Override public void componentShown(ComponentEvent e) { if (DEBUG) { System.err.println(e); } if (e.getSource() == canvas) { canvas.sendEventToBehaviorScheduler(e); } canvas.evaluateVisiblilty(); }
@Override public void componentResized(ComponentEvent e) { if (e.getSource() == canvas) { if (DEBUG) { System.err.println(e); } canvas.sendEventToBehaviorScheduler(e); canvas.evaluateVisiblilty(); canvas.redraw(); } }