Results 1 to 2 of 2
  1. #1
    NathanWick is offline Member
    Join Date
    Mar 2013
    Posts
    1
    Rep Power
    0

    Default I cant get a JScrollPane to appear

    Im not sure why but I cant seem to figure out why the JScrollPane when used, makes it and the JList invisible... I think it may be because I made a checkbox that, when checked, will make the Jlist invisible/visible.

    heres the code that initializes the JList

    Java Code:
    qAWords = new JList(arrayWordList);
    		qAWords.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    		qAWords.setMinimumSize(new Dimension(185, 160));
    		qAWords.setBounds(600, 50, 185, 160);
    		qAWords.setFixedCellWidth(100);
    		qAWords.setFixedCellHeight(15);
    		qAWords.setBackground(Color.decode("#8EFF80"));
    		qAWords.setVisible(qaWordVisible);
    and this is the event listener that sets the JList invisible or visible

    Java Code:
    showWords.addActionListener(new ActionListener()
    		{
    			public void actionPerformed(ActionEvent e)
    			{
    				if(showWords.isSelected())
    				{
    					wordListConvert();
    					qAWords.setListData(arrayWordList);
    					qaWordVisible = true;
    					qAWords.setVisible(qaWordVisible);
    					System.out.println("VISIBLE");
    				}
    				else
    				{
    					wordListConvert();
    					qAWords.setListData(arrayWordList);
    					qaWordVisible = false;
    					qAWords.setVisible(qaWordVisible);
    					System.out.println("INVISIBLE");
    				}
    			}
    		});
    and this is where i initialize the JScrollPanee

    Java Code:
    scrollPane = new JScrollPane(qAWords);
    		mainGuiPane.add(scrollPane);

  2. #2
    devo1929 is offline Member
    Join Date
    Mar 2012
    Posts
    1
    Rep Power
    0

    Default Re: I cant get a JScrollPane to appear

    I'm not sure what problems you are having. I used the code that you provided and it seemed to work just as you described it should... What exactly is happening that you believe it's not appearing?

Similar Threads

  1. Help with jScrollPane
    By weikang in forum SWT / JFace
    Replies: 1
    Last Post: 02-04-2011, 03:30 AM
  2. Need Help With JScrollPane Please
    By MemorableSmile in forum New To Java
    Replies: 4
    Last Post: 01-31-2011, 02:39 AM
  3. JScrollPane
    By hiddenpremise in forum AWT / Swing
    Replies: 2
    Last Post: 12-25-2010, 05:15 AM
  4. JScrollPane
    By UJJAL DHAR in forum New To Java
    Replies: 12
    Last Post: 08-17-2010, 06:47 PM
  5. jscrollpane
    By kaemonsaionji in forum New To Java
    Replies: 3
    Last Post: 02-25-2009, 08:39 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •