private void updateFontPreview() { SikuliIDE ide = SikuliIDE.getInstance(); Font font = new Font( (String) _cmbFontName.getSelectedItem(), Font.PLAIN, (Integer) _spnFontSize.getValue()); SikuliCodePane codePane = SikuliIDE.getInstance().getCurrentCodePane(); if (Utils.typeOfCodePane(codePane) == Utils.SikuliCodePaneType.SIKULI_PANE_TYPE_TEXT) { // preview only supported on text code panes SikuliTextPane textPane = (SikuliTextPane) (codePane.getComponent()); textPane.setFont(font); } }