< prev index next >

src/demo/share/jfc/Font2DTest/RangeMenu.java

Print this page

        

@@ -60,11 +60,11 @@
  * @author Ankit Patel [Conversion to Swing - 01/07/30]
  */
 
 /// Custom made choice menu that holds data for unicode range
 
-public final class RangeMenu extends JComboBox implements ActionListener {
+public final class RangeMenu extends JComboBox<String> implements ActionListener {
 
     private static final int[][] UNICODE_RANGES = getUnicodeRanges();
     private static final String[] UNICODE_RANGE_NAMES = getUnicodeRangeNames();
 
     private boolean useCustomRange = false;

@@ -179,25 +179,25 @@
     /// itemStateChanged() method. Part of change to Swing.
     public void actionPerformed( ActionEvent e ) {
         Object source = e.getSource();
 
         if ( source instanceof JComboBox ) {
-                String rangeName = (String)((JComboBox)source).getSelectedItem();
+                String rangeName = (String)((JComboBox<?>)source).getSelectedItem();
 
                 if ( rangeName.equals("Custom...") ) {
                     useCustomRange = true;
                     customRangeDialog.setLocationRelativeTo(parent);
-                    customRangeDialog.show();
+                    customRangeDialog.setVisible(true);
                 }
                 else {
                   useCustomRange = false;
                 }
                 parent.fireRangeChanged();
         }
         else if ( source instanceof JButton ) {
                 /// Since it is only "OK" button that sends any action here...
-                customRangeDialog.hide();
+                customRangeDialog.setVisible(false);
         }
     }
 
     private static int[][] getUnicodeRanges() {
         List<Integer> ranges = new ArrayList<>();
< prev index next >