public void run(){ JPopupMenu.setDefaultLightWeightPopupEnabled(false); createFrame(); currentPanel.add(canvas, BorderLayout.CENTER); frame.pack(); startApp(); frame.setLocationRelativeTo(null); frame.setVisible(true); } });
/** * Sets some sensible defaults for swing. * IMPORTANT! Needs to be called before main frame creation */ public static void setupDefaults() { // Force heavy-weight popups/tooltips. // Prevents them from being obscured by the game applet. ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); ToolTipManager.sharedInstance().setInitialDelay(300); JPopupMenu.setDefaultLightWeightPopupEnabled(false); UIManager.put("Button.foreground", Color.WHITE); UIManager.put("MenuItem.foreground", Color.WHITE); UIManager.put("Panel.background", ColorScheme.DARK_GRAY_COLOR); UIManager.put("ScrollBarUI", CustomScrollBarUI.class.getName()); UIManager.put("TextField.selectionBackground", ColorScheme.BRAND_ORANGE_TRANSPARENT); UIManager.put("TextField.selectionForeground", Color.WHITE); UIManager.put("FormattedTextField.selectionBackground", ColorScheme.BRAND_ORANGE_TRANSPARENT); UIManager.put("FormattedTextField.selectionForeground", Color.WHITE); UIManager.put("TextArea.selectionBackground", ColorScheme.BRAND_ORANGE_TRANSPARENT); UIManager.put("TextArea.selectionForeground", Color.WHITE); // Do not render shadows under popups/tooltips. // Fixes black boxes under popups that are above the game applet. System.setProperty("jgoodies.popupDropShadowEnabled", "false"); // Do not fill in background on repaint. Reduces flickering when // the applet is resized. System.setProperty("sun.awt.noerasebackground", "true"); }
public void run() { JPopupMenu.setDefaultLightWeightPopupEnabled(false);
private void setupMenuBar() { JPopupMenu.setDefaultLightWeightPopupEnabled(false); setJMenuBar(new com.mrcrayfish.modelcreator.component.Menu(this)); }
/** * Launch the application. * * @throws Exception * @throws IllegalAccessException * @throws InstantiationException * @throws ClassNotFoundException */ public static void main(String[] args) throws Exception { try { javax.swing.UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); } catch (Exception ex) { } JPopupMenu.setDefaultLightWeightPopupEnabled(false); ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); EventQueue.invokeLater(new Runnable() { public void run() { try { Main window = new Main(); window.frmCdboxdSceneEditor.setVisible(true); Canvas canvas = new Canvas(); EditorAdapter.setupCanvas(canvas); Main.INSTANCE.canvasPanel.add(canvas); } catch (Exception e) { e.printStackTrace(); } } }); }
/** * Checks the component and all children to ensure that everything is pure * Swing. We can only draw lightweights. * * * We'll also set PopupMenus to heavyweight and fix JViewport blitting. */ protected void verifyHierarchy(Component comp) { JPopupMenu.setDefaultLightWeightPopupEnabled(false); if (!(comp instanceof JComponent)) { Logger.getLogger(GLG2DCanvas.class.getName()).warning("Drawable component and children should be pure Swing: " + comp + " does not inherit JComponent"); } if (comp instanceof JViewport) { ((JViewport) comp).setScrollMode(JViewport.SIMPLE_SCROLL_MODE); } if (comp instanceof Container) { Container cont = (Container) comp; for (int i = 0; i < cont.getComponentCount(); i++) { verifyHierarchy(cont.getComponent(i)); } } }
public MenuMgr() { super(); JPopupMenu.setDefaultLightWeightPopupEnabled(false); menu = new JMenu("File"); menu.add(new CreateWindowAction("Create New VTK Window")); menu.add(new KillAction("Exit")); add(menu); addMenuBar(this); } }
JPopupMenu.setDefaultLightWeightPopupEnabled(false); JMenuBar menuBar = new JMenuBar(); menuBar.add(menu);
JPopupMenu.setDefaultLightWeightPopupEnabled(false); JMenuBar menuBar = new JMenuBar(); menuBar.add(menu);
public static void initSwingComponentStyle() { try { JPopupMenu.setDefaultLightWeightPopupEnabled(false); UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); UIManager.getDefaults().put("SplitPane.border", BorderFactory.createEmptyBorder()); setDefaultSwingFont(new FontUIResource(Resources.fonts().get("OpenSans.ttf", Font.PLAIN, 11))); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) { log.log(Level.SEVERE, e.getLocalizedMessage(), e); } }
/** * Checks the component and all children to ensure that everything is pure * Swing. We can only draw lightweights. * * * We'll also set PopupMenus to heavyweight and fix JViewport blitting. */ protected void verifyHierarchy(Component comp) { JPopupMenu.setDefaultLightWeightPopupEnabled(false); if (comp instanceof JComponent) { ((JComponent) comp).setDoubleBuffered(false); } if (!(comp instanceof JComponent)) { Logger.getLogger(GLG2DCanvas.class.getName()).warning("Drawable component and children should be pure Swing: " + comp + " does not inherit JComponent"); } if (comp instanceof JViewport) { ((JViewport) comp).setScrollMode(JViewport.SIMPLE_SCROLL_MODE); } if (comp instanceof Container) { Container cont = (Container) comp; for (int i = 0; i < cont.getComponentCount(); i++) { verifyHierarchy(cont.getComponent(i)); } } }
JPopupMenu.setDefaultLightWeightPopupEnabled(false); compositePanel = new JPanel(); compositePanel.setBackground(Color.white);
public GraphCanvas() { super(); glCanvas = new GLCanvas(getCaps()); super.initDrawable(glCanvas); // glCanvas.setMinimumSize(new Dimension(0, 0)); //Fix Canvas resize Issue //Basic init graphComponent = (Component) glCanvas; // graphComponent.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); //False lets the components appear on top of the canvas JPopupMenu.setDefaultLightWeightPopupEnabled(false); ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); }
private void initComponent() { JPopupMenu.setDefaultLightWeightPopupEnabled(false); ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
/** Facade method used to allow mixing of lightweight and heavyweight components in the * desktop. * <p> * This method is a shortcut for : * <pre> * ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); * JPopupMenu.setDefaultLightWeightPopupEnabled(false); * setLightweigthComponentEnabled(false); * getAutoHidePolicy().setExpansionDuration(0); * </pre> */ public static void initHeavyWeightUsage() { // for now, there are only two methods used. ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); JPopupMenu.setDefaultLightWeightPopupEnabled(false); setLightweigthComponentEnabled(false); getAutoHidePolicy().setExpansionDuration(0); }
JPopupMenu.setDefaultLightWeightPopupEnabled(false); installNimrod();
public NewtGraphCanvas() { super(); glWindow = GLWindow.create(getCaps()); // glWindow.setSurfaceScale(new float[]{ScalableSurface.AUTOMAX_PIXELSCALE, ScalableSurface.AUTOMAX_PIXELSCALE}); glCanvas = new NewtCanvasAWT(glWindow); super.initDrawable(glWindow); // glCanvas.setFocusable(true); // glCanvas.setIgnoreRepaint(true); // glCanvas.setMinimumSize(new Dimension(0, 0)); //Fix Canvas resize Issue // glCanvas.setMinimumSize(new Dimension(0, 0)); //Fix Canvas resize Issue //Basic init graphComponent = (Component) glCanvas; window = glWindow; // graphComponent.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); //False lets the components appear on top of the canvas JPopupMenu.setDefaultLightWeightPopupEnabled(false); ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); }
SelectDragMode sdm = new SelectDragMode(mm); JPopupMenu.setDefaultLightWeightPopupEnabled(false); ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
JPopupMenu.setDefaultLightWeightPopupEnabled(false); plDialog = new PointListDialog(this.win); plDialog.addWindowListener(new WindowAdapter() {
public MenuBar(ISettingsManager properties, IWindowManagerExt windowManager, IBattleManager battleManager, IRecordManager recordManager, ICpuManager cpuManager) { this.properties = properties; this.windowManager = windowManager; this.battleManager = battleManager; this.recordManager = recordManager; this.cpuManager = cpuManager; // FNL: Make sure that menus are heavy-weight components so that the menus are not painted // behind the BattleView which is a heavy-weight component. This must be done before // adding any menu to the menubar. JPopupMenu.setDefaultLightWeightPopupEnabled(false); add(getBattleMenu()); add(getRobotMenu()); add(getOptionsMenu()); add(getHelpMenu()); }