if (regType.isSelected())
if (snesType.isSelected())
    private void initGotoDialog()    {        gotoDialog = new JDialog(mainWindow, "Goto Offset", true);        gotoDialog.setLocation(gotoDialog.getOwner().getLocation());        final JTextField tf = HackModule.createSizedJTextField(6);        final JLabel prefix = new JLabel("0x");        prefix.setHorizontalAlignment(SwingConstants.RIGHT);        prefix.setPreferredSize(new Dimension(20, 5));        JPanel diaTop = new JPanel(new BorderLayout());        diaTop.add(tf, BorderLayout.CENTER);        diaTop.add(prefix, BorderLayout.WEST);        gotoDialog.getContentPane().setLayout(new BorderLayout());        gotoDialog.getContentPane().add(diaTop, BorderLayout.NORTH);        ButtonGroup type = new ButtonGroup();        final JRadioButton regType = new JRadioButton("Regular (0x)"), snesType = new JRadioButton(            "SNES ($)");        regType.setSelected(true);        type.add(regType);        type.add(snesType);        regType.addChangeListener(new ChangeListener()        {            public void stateChanged(ChangeEvent arg0)            {                prefix.setText(regType.isSelected() ? "0x" : "$");            }        });        JPanel typeSel = new JPanel(new BorderLayout());        typeSel.add(regType, BorderLayout.WEST);        typeSel.add(snesType, BorderLayout.EAST);        gotoDialog.getContentPane().add(typeSel, BorderLayout.CENTER);        JPanel buttons = new JPanel(new FlowLayout());        JButton gotob = new JButton("Goto");        gotoDialog.getRootPane().setDefaultButton(gotob);        gotob.addActionListener(new ActionListener()        {            public void actionPerformed(ActionEvent ae)            {                int offset;                try                {                    offset = Integer.parseInt(HackModule.killSpaces(tf                        .getText()), 16);                    if (regType.isSelected())                        offset = HackModule.toRegPointer(offset);                }                catch (NumberFormatException e)                {                    return;                }                if (!gotoOffset(offset))                    JOptionPane.showMessageDialog(gotoDialog,                        "The offset you entered is not\n" + "in the ROM.",                        "Unable to find offset", JOptionPane.ERROR_MESSAGE);                else                    gotoDialog.setVisible(false);            }        });        buttons.add(gotob);        JButton closeb = new JButton("Cancel");        closeb.addActionListener(new ActionListener()        {            public void actionPerformed(ActionEvent ae)            {                gotoDialog.setVisible(false);            }        });        buttons.add(closeb);        gotoDialog.getContentPane().add(buttons, BorderLayout.SOUTH);        gotoDialog.pack();    }