Java Code Examples for java.awt.event.ComponentAdapter

The following examples show how to use java.awt.event.ComponentAdapter. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: btdex   Source File: Toast.java    License: GNU General Public License v3.0 6 votes vote down vote up
private void createGUI(){
    addComponentListener(new ComponentAdapter() {
        @Override
        public void componentResized(ComponentEvent e) {
            setShape(new RoundRectangle2D.Double(0, 0, getWidth(), getHeight(), WINDOW_RADIUS, WINDOW_RADIUS));
        }
    });
    
    setAlwaysOnTop(true);
    setUndecorated(true);
    setFocusableWindowState(false);
    setModalityType(ModalityType.MODELESS);
    getContentPane().setBackground(mBackgroundColor);
    
    JLabel label = new JLabel(mText);
    label.setFont(label.getFont().deriveFont(16.0f));
    label.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
    label.setForeground(mForegroundColor);
    add(label);
    pack();
}
 
Example 2
Source Project: dragonwell8_jdk   Source File: FontPanel.java    License: GNU General Public License v2.0 6 votes vote down vote up
public FontPanel( Font2DTest demo, JFrame f ) {
    f2dt = demo;
    parent = f;

    verticalBar = new JScrollBar ( JScrollBar.VERTICAL );
    fc = new FontCanvas();

    this.setLayout( new BorderLayout() );
    this.add( "Center", fc );
    this.add( "East", verticalBar );

    verticalBar.addAdjustmentListener( this );
    this.addComponentListener( new ComponentAdapter() {
        public void componentResized( ComponentEvent e ) {
            updateBackBuffer = true;
            updateFontMetrics = true;
        }
    });

    /// Initialize font and its infos
    testFont = new Font(fontName, fontStyle, (int)fontSize);
    if ((float)((int)fontSize) != fontSize) {
        testFont = testFont.deriveFont(fontSize);
    }
    updateFontInfo();
}
 
Example 3
Source Project: haystack   Source File: FlutterReduxGen.java    License: MIT License 6 votes vote down vote up
@Override
public void onJsonParsed(PageModel pageModel) {
    if (pageModel.isUIOnly) {
        checkProjectStructure(pageModel);
    } else {
        ModelTableDialog tableDialog = new ModelTableDialog(pageModel, languageResolver,
                textResources, this);
        if (lastDialogLocation != null) {
            tableDialog.setLocation(lastDialogLocation);
        }
        tableDialog.addComponentListener(new ComponentAdapter() {
            public void componentMoved(ComponentEvent e) {
                lastDialogLocation = tableDialog.getLocation();
            }
        });

        tableDialog.pack();
        tableDialog.setVisible(true);
    }
}
 
Example 4
Source Project: ghidra   Source File: VariableHeightPanel.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * 
 * Construct a new VariableHeigthPanel.
 * @param pack true means to fit as many components on a row, not worrying about lining up 
 *        columns; false means to fit as many components on a row, and line up the columns 
 *        as if in a grid
 * @param hgap horizontal gap between components
 * @param vgap vertical gap between components
 */
public VariableHeightPanel(final boolean pack, int hgap, int vgap) {
	this.pack = pack;
	this.hGap = hgap;
	this.vGap = vgap;

	setLayout(new VariableHeightLayoutManager(hGap, vGap, pack));

	// this is needed to know when our the layout model changes this panel's height, which
	// requires that we notify our containing parent of the change so that it will re-layout
	// it's children to deal with our new space
	addComponentListener(new ComponentAdapter() {
		@Override
		public void componentResized(ComponentEvent e) {
			invalidate();
			getRootComponent(VariableHeightPanel.this).validate();
		}
	});
}
 
Example 5
Source Project: arcusplatform   Source File: DashboardSection.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected Component createComponent() {
   JPanel content = new JPanel(new BorderLayout());
   content.add(new JScrollPane(createLogTable()), BorderLayout.CENTER);
   content.add(createToolbar(), BorderLayout.SOUTH);
   content.addComponentListener(new ComponentAdapter() {

      /* (non-Javadoc)
       * @see java.awt.event.ComponentAdapter#componentShown(java.awt.event.ComponentEvent)
       */
      @Override
      public void componentShown(ComponentEvent e) {
         controller.refreshLogs();
      }
      
   });
   return content;
}
 
Example 6
Source Project: arcusplatform   Source File: BehaviorSection.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected Component createComponent() {
   JPanel content = new JPanel(new BorderLayout());
   content.add(new JScrollPane(createBehaviorTable()), BorderLayout.CENTER);
   content.add(createToolbar(), BorderLayout.SOUTH);
   content.addComponentListener(new ComponentAdapter() {

      @Override
      public void componentShown(ComponentEvent e) {
         controller.refreshBehaviors();
      }

   });

   IrisClientFactory
         .getClient().addMessageListener(l -> {
            if (isBehavior().apply(l.getEvent())) {
               controller.refreshBehaviors();
            }
         });
   return content;
}
 
Example 7
Source Project: arcusplatform   Source File: ModelStoreViewBuilder.java    License: Apache License 2.0 6 votes vote down vote up
public Component build() {
   JPanel panel = new JPanel();
   CardLayout layout = new CardLayout();
   panel.setLayout(layout);
   panel.add(buildSelectorPanel(), "selector");
   panel.add(buildDetailPanel(), "details");
   if(showListeners.hasListeners()) {
      panel.addComponentListener(new ComponentAdapter() {
         @Override
         public void componentShown(ComponentEvent e) {
            showListeners.fireEvent(e);
         }
         
      });
   }
   selectionModel.addSelectionListener((o) -> {
      if(o.isPresent()) {
         layout.show(panel, "details");
      }
      else {
         layout.show(panel, "selector");
      }
   });
   
   return panel;
}
 
Example 8
Source Project: arcusplatform   Source File: PagingFilterToolbar.java    License: Apache License 2.0 6 votes vote down vote up
private void init() {
   filterDescription = new JLabel("Filtering...");

   setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
   add(new JButton(filterAction));
   add(filterDescription);
   add(Box.createHorizontalGlue());
   add(new JButton(prevAction));
   add(new JButton(nextAction));
   
   addComponentListener(new ComponentAdapter() {
      @Override
      public void componentShown(ComponentEvent e) {
         reloadCurrentPage();
      }
   });
}
 
Example 9
Source Project: TencentKona-8   Source File: FontPanel.java    License: GNU General Public License v2.0 6 votes vote down vote up
public FontPanel( Font2DTest demo, JFrame f ) {
    f2dt = demo;
    parent = f;

    verticalBar = new JScrollBar ( JScrollBar.VERTICAL );
    fc = new FontCanvas();

    this.setLayout( new BorderLayout() );
    this.add( "Center", fc );
    this.add( "East", verticalBar );

    verticalBar.addAdjustmentListener( this );
    this.addComponentListener( new ComponentAdapter() {
        public void componentResized( ComponentEvent e ) {
            updateBackBuffer = true;
            updateFontMetrics = true;
        }
    });

    /// Initialize font and its infos
    testFont = new Font(fontName, fontStyle, (int)fontSize);
    if ((float)((int)fontSize) != fontSize) {
        testFont = testFont.deriveFont(fontSize);
    }
    updateFontInfo();
}
 
Example 10
Source Project: jdk8u60   Source File: FontPanel.java    License: GNU General Public License v2.0 6 votes vote down vote up
public FontPanel( Font2DTest demo, JFrame f ) {
    f2dt = demo;
    parent = f;

    verticalBar = new JScrollBar ( JScrollBar.VERTICAL );
    fc = new FontCanvas();

    this.setLayout( new BorderLayout() );
    this.add( "Center", fc );
    this.add( "East", verticalBar );

    verticalBar.addAdjustmentListener( this );
    this.addComponentListener( new ComponentAdapter() {
        public void componentResized( ComponentEvent e ) {
            updateBackBuffer = true;
            updateFontMetrics = true;
        }
    });

    /// Initialize font and its infos
    testFont = new Font(fontName, fontStyle, (int)fontSize);
    if ((float)((int)fontSize) != fontSize) {
        testFont = testFont.deriveFont(fontSize);
    }
    updateFontInfo();
}
 
Example 11
Source Project: mylizzie   Source File: AnalysisFrame.java    License: GNU General Public License v3.0 6 votes vote down vote up
/**
 * Create the GUI and show it. For thread safety, this method should be
 * invoked from the event-dispatching thread.
 */
public static JDialog createAnalysisDialog(JFrame owner) {
    // Create and set up the window.
    JDialog dialog = new JDialog(owner, resourceBundle.getString("AnalysisFrame.title"));

    // Create and set up the content pane.
    final AnalysisFrame newContentPane = new AnalysisFrame();
    newContentPane.setOpaque(true); // content panes must be opaque
    dialog.setContentPane(newContentPane);

    // Display the window.
    dialog.setSize(800, 600);

    // Handle close event
    dialog.addComponentListener(new ComponentAdapter() {
        @Override
        public void componentHidden(ComponentEvent e) {
            newContentPane.getAnalysisTableModel().setSelectedMove(null);
            Lizzie.optionSetting.setAnalysisWindowShow(false);
        }
    });

    return dialog;
}
 
Example 12
Source Project: radiance   Source File: MatrixRain.java    License: BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
public MatrixPanel() {
    try {
        InputStream is = MatrixRain.class.getClassLoader().getResourceAsStream(
                "fonts/katakana.ttf");
        Font kf = Font.createFont(Font.TRUETYPE_FONT, is);
        int fontSize = 14;
        font = kf.deriveFont(Font.BOLD, fontSize);
    } catch (Exception exc) {
        exc.printStackTrace();
    }

    SwingRepaintTimeline.repaintBuilder(this).playLoop(RepeatBehavior.LOOP);

    this.drops = new ArrayList<>();
    this.addComponentListener(new ComponentAdapter() {
        @Override
        public void componentResized(ComponentEvent e) {
            while (drops.size() < 40)
                addDrop();
        }
    });
}
 
Example 13
Source Project: 3Dscript   Source File: SingleSlider.java    License: BSD 2-Clause "Simplified" License 6 votes vote down vote up
public SingleSliderCanvas(final int realMax, int setMax, Color color, SingleSlider slider) {
	this.color = color;
	this.slider = slider;
	this.setMax = setMax;
	this.realMax = realMax;

	this.diagram = new DiagramCanvas();
	diagram.setMargins(2, 2, 2, 2);
	diagram.setBoundingBox(0, 0, realMax, 5);

	this.addMouseMotionListener(this);
	this.addMouseListener(this);
	this.setBackground(Color.WHITE);
	this.setFont(new Font("Helvetica", Font.PLAIN, 10));
	this.addComponentListener(new ComponentAdapter() {
		@Override
		public void componentResized(ComponentEvent e) {
			diagram.setSizes(getWidth(), getHeight());
		}
	});
}
 
Example 14
Source Project: 3Dscript   Source File: DoubleSlider.java    License: BSD 2-Clause "Simplified" License 6 votes vote down vote up
public DoubleSliderCanvas(final int[] realMinMax, int[] setMinMax, Color color, DoubleSlider slider) {
	this.color = color;
	this.slider = slider;
	this.setMinMax = setMinMax;
	this.realMinMax = realMinMax;

	this.diagram = new DiagramCanvas();
	diagram.setMargins(2, 2, 2, 2);
	diagram.setBoundingBox(realMinMax[0], 0, realMinMax[1], 5);

	this.addMouseMotionListener(this);
	this.addMouseListener(this);
	this.setBackground(Color.WHITE);
	this.setFont(new Font("Helvetica", Font.PLAIN, 10));
	this.addComponentListener(new ComponentAdapter() {
		@Override
		public void componentResized(ComponentEvent e) {
			diagram.setSizes(getWidth(), getHeight());
			repaint();
		}
	});
}
 
Example 15
Source Project: openjdk-jdk8u   Source File: FontPanel.java    License: GNU General Public License v2.0 6 votes vote down vote up
public FontPanel( Font2DTest demo, JFrame f ) {
    f2dt = demo;
    parent = f;

    verticalBar = new JScrollBar ( JScrollBar.VERTICAL );
    fc = new FontCanvas();

    this.setLayout( new BorderLayout() );
    this.add( "Center", fc );
    this.add( "East", verticalBar );

    verticalBar.addAdjustmentListener( this );
    this.addComponentListener( new ComponentAdapter() {
        public void componentResized( ComponentEvent e ) {
            updateBackBuffer = true;
            updateFontMetrics = true;
        }
    });

    /// Initialize font and its infos
    testFont = new Font(fontName, fontStyle, (int)fontSize);
    if ((float)((int)fontSize) != fontSize) {
        testFont = testFont.deriveFont(fontSize);
    }
    updateFontInfo();
}
 
Example 16
Source Project: netbeans   Source File: AutoHideStatusText.java    License: Apache License 2.0 6 votes vote down vote up
private AutoHideStatusText( JFrame frame, JPanel statusContainer  ) {
    this.statusContainer = statusContainer;
    Border outerBorder = UIManager.getBorder( "Nb.ScrollPane.border" ); //NOI18N
    if( null == outerBorder ) {
        outerBorder = BorderFactory.createEtchedBorder();
    }
    panel.setBorder( BorderFactory.createCompoundBorder( outerBorder, 
            BorderFactory.createEmptyBorder(3,3,3,3) ) );
    lblStatus.setName("AutoHideStatusTextLabel"); //NOI18N
    panel.add( lblStatus, BorderLayout.CENTER );
    frame.getLayeredPane().add( panel, Integer.valueOf( 101 ) );
    StatusDisplayer.getDefault().addChangeListener( this );

    frame.addComponentListener( new ComponentAdapter() {
        @Override
        public void componentResized( ComponentEvent e ) {
            run();
        }
    });
}
 
Example 17
Source Project: netbeans   Source File: UIUtils.java    License: Apache License 2.0 6 votes vote down vote up
public static void ensureMinimumSize(Component comp) {
    comp = getParentWindow(comp);

    if (comp != null) {
        final Component top = comp;
        top.addComponentListener(new ComponentAdapter() {
                public void componentResized(ComponentEvent e) {
                    Dimension d = top.getSize();
                    Dimension min = top.getMinimumSize();

                    if ((d.width < min.width) || (d.height < min.height)) {
                        top.setSize(Math.max(d.width, min.width), Math.max(d.height, min.height));
                    }
                }
            });
    }
}
 
Example 18
public FontPanel( Font2DTest demo, JFrame f ) {
    f2dt = demo;
    parent = f;

    verticalBar = new JScrollBar ( JScrollBar.VERTICAL );
    fc = new FontCanvas();

    this.setLayout( new BorderLayout() );
    this.add( "Center", fc );
    this.add( "East", verticalBar );

    verticalBar.addAdjustmentListener( this );
    this.addComponentListener( new ComponentAdapter() {
        public void componentResized( ComponentEvent e ) {
            updateBackBuffer = true;
            updateFontMetrics = true;
        }
    });

    /// Initialize font and its infos
    testFont = new Font(fontName, fontStyle, (int)fontSize);
    if ((float)((int)fontSize) != fontSize) {
        testFont = testFont.deriveFont(fontSize);
    }
    updateFontInfo();
}
 
Example 19
Source Project: openjdk-jdk9   Source File: FontPanel.java    License: GNU General Public License v2.0 6 votes vote down vote up
public FontPanel( Font2DTest demo, JFrame f ) {
    f2dt = demo;
    parent = f;

    verticalBar = new JScrollBar ( JScrollBar.VERTICAL );
    fc = new FontCanvas();

    this.setLayout( new BorderLayout() );
    this.add( "Center", fc );
    this.add( "East", verticalBar );

    verticalBar.addAdjustmentListener( this );
    this.addComponentListener( new ComponentAdapter() {
        public void componentResized( ComponentEvent e ) {
            updateFontMetrics = true;
        }
    });

    /// Initialize font and its infos
    testFont = new Font(fontName, fontStyle, (int)fontSize);
    if ((float)((int)fontSize) != fontSize) {
        testFont = testFont.deriveFont(fontSize);
    }
    updateFontInfo();
}
 
Example 20
Source Project: openjdk-jdk9   Source File: SetShape.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
public void initGUI() {
    if (windowClass.equals(Frame.class)) {
        window = new Frame();
        ((Frame) window).setUndecorated(true);
    } else  if (windowClass.equals(Dialog.class)) {
        window = new Dialog(background);
        ((Dialog) window).setUndecorated(true);
    } else {
        window = new Window(background);
    }
    window.setBackground(FG_COLOR);
    window.addComponentListener(new ComponentAdapter() {
        @Override
        public void componentResized(ComponentEvent e) {
            window.setShape(shape);
        }
    });
    window.setSize(200, 200);
    window.setLocation(2*dl, 2*dl);
    window.setVisible(true);

    System.out.println("Checking " + window.getClass().getName() + "...");
}
 
Example 21
Source Project: jdk8u-jdk   Source File: FontPanel.java    License: GNU General Public License v2.0 6 votes vote down vote up
public FontPanel( Font2DTest demo, JFrame f ) {
    f2dt = demo;
    parent = f;

    verticalBar = new JScrollBar ( JScrollBar.VERTICAL );
    fc = new FontCanvas();

    this.setLayout( new BorderLayout() );
    this.add( "Center", fc );
    this.add( "East", verticalBar );

    verticalBar.addAdjustmentListener( this );
    this.addComponentListener( new ComponentAdapter() {
        public void componentResized( ComponentEvent e ) {
            updateBackBuffer = true;
            updateFontMetrics = true;
        }
    });

    /// Initialize font and its infos
    testFont = new Font(fontName, fontStyle, (int)fontSize);
    if ((float)((int)fontSize) != fontSize) {
        testFont = testFont.deriveFont(fontSize);
    }
    updateFontInfo();
}
 
Example 22
/**
 * Sets the component to be shown.
 * @param component the component to be shown.
 * @param parent the container to which the shown component should be added.
 *               This parameter can be null if you add the component yourself.
 */
public void setComponent(Component component) {
    this.component = component;
    if (null != component) {
        component.addComponentListener(new ComponentAdapter() {

            @Override
            public void componentHidden(ComponentEvent e) {
                if (null != unselectButton && isSelected()) {
                    unselectButton.setSelected(true);
                }
            }
            
        });
    }
}
 
Example 23
Source Project: hottub   Source File: FontPanel.java    License: GNU General Public License v2.0 6 votes vote down vote up
public FontPanel( Font2DTest demo, JFrame f ) {
    f2dt = demo;
    parent = f;

    verticalBar = new JScrollBar ( JScrollBar.VERTICAL );
    fc = new FontCanvas();

    this.setLayout( new BorderLayout() );
    this.add( "Center", fc );
    this.add( "East", verticalBar );

    verticalBar.addAdjustmentListener( this );
    this.addComponentListener( new ComponentAdapter() {
        public void componentResized( ComponentEvent e ) {
            updateBackBuffer = true;
            updateFontMetrics = true;
        }
    });

    /// Initialize font and its infos
    testFont = new Font(fontName, fontStyle, (int)fontSize);
    if ((float)((int)fontSize) != fontSize) {
        testFont = testFont.deriveFont(fontSize);
    }
    updateFontInfo();
}
 
Example 24
Source Project: ApkToolPlus   Source File: ProgressDialog.java    License: Apache License 2.0 6 votes vote down vote up
private void setupEventHandlers() {

        addComponentListener(new ComponentAdapter() {
            public void componentShown(ComponentEvent event) {
                final Thread task = new Thread(runnable);
                task.start();
                new Thread() {
                    public void run() {
                        try {
                            task.join();
                        } catch (InterruptedException e) {
                        }
                        SwingUtilities.invokeLater(new Runnable() {
                            public void run() {
                                setVisible(false);
                            }
                        });
                    }
                }.start();
            }
        });
    }
 
Example 25
Source Project: openjdk-8-source   Source File: FontPanel.java    License: GNU General Public License v2.0 6 votes vote down vote up
public FontPanel( Font2DTest demo, JFrame f ) {
    f2dt = demo;
    parent = f;

    verticalBar = new JScrollBar ( JScrollBar.VERTICAL );
    fc = new FontCanvas();

    this.setLayout( new BorderLayout() );
    this.add( "Center", fc );
    this.add( "East", verticalBar );

    verticalBar.addAdjustmentListener( this );
    this.addComponentListener( new ComponentAdapter() {
        public void componentResized( ComponentEvent e ) {
            updateBackBuffer = true;
            updateFontMetrics = true;
        }
    });

    /// Initialize font and its infos
    testFont = new Font(fontName, fontStyle, (int)fontSize);
    if ((float)((int)fontSize) != fontSize) {
        testFont = testFont.deriveFont(fontSize);
    }
    updateFontInfo();
}
 
Example 26
Source Project: gemfirexd-oss   Source File: SequenceDiagram.java    License: Apache License 2.0 6 votes vote down vote up
public SequenceDiagram(long minTime, long maxTime, List<String> lineNames, LineMapper lineMapper) {
    this.lineNames = lineNames;
    this.shortLineNames = parseShortNames(lineNames, lineMapper);
    this.minTime = minTime;
    this.maxTime = maxTime;
    int width = getInitialWidth();
    int height = 500;
    super.setPreferredSize(new Dimension(width, height));
    resizeMe(width, height);
    addComponentListener(new ComponentAdapter() {
        @Override
        public void componentResized(ComponentEvent e) {
            Component source = (Component) e.getSource();
            resizeMe(source.getWidth(), source.getHeight());
        }
    });
    setBackground(Color.WHITE);
}
 
Example 27
Source Project: scelight   Source File: XTabbedPane.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void addTab( final String title, final IRIcon ricon, final Producer< JComponent > tabProducer, final boolean addTabMnemonic,
        final boolean closeable, final Runnable beforeCloseTask ) {
	
	// Wrapper component that listens to being shown first
	final BorderPanel p = new BorderPanel();
	p.addComponentListener( new ComponentAdapter() {
		@Override
		public void componentShown( final ComponentEvent event ) {
			p.addCenter( tabProducer.produce() );
			p.removeComponentListener( this );
			p.validate();
		}
	} );
	
	addTab( title, ricon, p, addTabMnemonic, closeable, beforeCloseTask );
}
 
Example 28
Source Project: visualvm   Source File: UIUtils.java    License: GNU General Public License v2.0 6 votes vote down vote up
public static void ensureMinimumSize(Component comp) {
    comp = getParentWindow(comp);

    if (comp != null) {
        final Component top = comp;
        top.addComponentListener(new ComponentAdapter() {
                public void componentResized(ComponentEvent e) {
                    Dimension d = top.getSize();
                    Dimension min = top.getMinimumSize();

                    if ((d.width < min.width) || (d.height < min.height)) {
                        top.setSize(Math.max(d.width, min.width), Math.max(d.height, min.height));
                    }
                }
            });
    }
}
 
Example 29
public ClassViewer(ViewerFile file) {
    super(file);
    updateName();
    this.setLayout(new BorderLayout());

    this.sp = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, panels.get(0), panels.get(1));
    this.sp2 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, sp, panels.get(2));
    this.add(sp2, BorderLayout.CENTER);

    refresh(null);
    this.addComponentListener(new ComponentAdapter() {
        public void componentResized(ComponentEvent e) {
            resetDivider();
        }
    });
}
 
Example 30
Source Project: openjdk-8   Source File: FontPanel.java    License: GNU General Public License v2.0 6 votes vote down vote up
public FontPanel( Font2DTest demo, JFrame f ) {
    f2dt = demo;
    parent = f;

    verticalBar = new JScrollBar ( JScrollBar.VERTICAL );
    fc = new FontCanvas();

    this.setLayout( new BorderLayout() );
    this.add( "Center", fc );
    this.add( "East", verticalBar );

    verticalBar.addAdjustmentListener( this );
    this.addComponentListener( new ComponentAdapter() {
        public void componentResized( ComponentEvent e ) {
            updateBackBuffer = true;
            updateFontMetrics = true;
        }
    });

    /// Initialize font and its infos
    testFont = new Font(fontName, fontStyle, (int)fontSize);
    if ((float)((int)fontSize) != fontSize) {
        testFont = testFont.deriveFont(fontSize);
    }
    updateFontInfo();
}