No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
Hi. I have an issue. That's given a snippet of class. [CODE]public constructor () // the start of constructor { JPanel courseChooserPanel = new JPanel(card); box.add(courseChooserPanel); CardLayout card = new CardLayout(); Department comp = Department.get("COMP"); // refers to another class CourseChooser compPanel = new CourseChooser(this,comp); // refers to another class … |
|
Hi. I need some help. That's a snippet of the class. [code=java]public constructor ( ChooserListener callback ) { // that's a constructor super(); Loader.load(); this.callback= callback; JFrame frame = new JFrame(); frame.getContentPane(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.add(this); frame.setSize(300,330); frame.setVisible(true); JPanel lectures = new JPanel(); String items [] ={BLANK,COMP,EIMC,MATH}; JList list = new JList(items); … |
|
Hi. I need some help. Below is given a snippet of Java code. [code=Java]deptList = new JList(deptName); add(new JScrollPane(deptList)); deptList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); deptList.addListSelectionListener( listSelectionListener); } ListSelectionListener listSelectionListener = new ListSelectionListener() { public void valueChanged (ListSelectionEvent e) { if (e.getValueIsAdjusting()== false); callback.tell(dept[deptList.getSelectedIndex()]); } }; [/code] When you run it, it creates 2 windows. … |