Note that there are some explanatory texts on larger screens.

plurals
  1. POJlist not showing up/appearing in applet
    primarykey
    data
    text
    <p>For some reason the <code>Jlist</code> will not show up on my applet. </p> <p>It shows up just right of the slider but only when you click on the individual elements.</p> <p>I tried <code>this.validate()</code> and <code>this.repaint()</code> with no luck. Can anyone help me out? </p> <pre><code>import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JApplet; import java.awt.Graphics; import javax.swing.JList; import javax.swing.JRadioButton; import javax.swing.JSlider; import javax.swing.ListSelectionModel; public class HeatingHome extends JApplet implements ActionListener { // declare variables here JRadioButton switchIt = new JRadioButton(); JSlider tempControl = new JSlider(JSlider.VERTICAL, 10, 15, 11); String[] theRooms = {"Porch", "Kitchen", "Living Room", "Hall", "Bedroom 1", "Bathroom", "Bedroom 2"}; JList roomsList = new JList(theRooms); public void init() { setSize(1000,600); } public void paint(Graphics g) { super.paint(g); roomsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); roomsList.setBounds(700, 200, 150, 150); roomsList.setVisible(true); roomsList.setEnabled(true); add(roomsList); //tempControl.addChangeListener(e); tempControl.setMajorTickSpacing(10); tempControl.setPaintLabels(true); tempControl.setMinorTickSpacing(1); tempControl.setPaintTicks(true); tempControl.setBounds(600, 200, 100, 200); tempControl.setEnabled(true); add(tempControl); } @Override public void actionPerformed(ActionEvent e) { throw new UnsupportedOperationException("Not supported yet."); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload