源程序: import java.awt.*; import java.awt.event.*; import javax. (1) .*; import java.io. *; public class Java_3 public static void main(String[]args) ExceptTestFrame flame=new ExceptTestFrame(); frame.setDefauhCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true);
class ExceptTestFrame extends JFrame public ExceptTestFrame() setTitle("ExceptTest"); Container contentPane=getContentPane(); ExceptTestPanel panel=new ExceptTestPanel(); contentPane.add(panel); pack();
class ExceptTestPanel extends Box; public ExceptTestPanel() super(BoxLayout.Y_AXIS); group=new ButtonGroup(); addRadioBunon("Integer divide by zero", new ActionListener() public void actionPerformed(ActionEvent event) a[1]=1/(a.lengtb-a.length);