Closed Thread
Results 1 to 3 of 3

Thread: JScrollPane with width

  1. #1
    j.lai is offline Newbie
    Join Date
    Dec 2009
    Posts
    21
    Rep Power
    0

    JScrollPane with width

    Code:
    String width = "1514153253245435432563245342";
    		listArea.setPrototypeCellValue(width);
    		listArea.setFont(new Font("Consolas",Font.PLAIN,10));
    		listArea.setVisibleRowCount(15);
    		listArea.addListSelectionListener(new ListListener());
    		JScrollPane listScrollPane = new JScrollPane(listArea);
    		listArea.setListData(listVector);
    		searchCenterPanel.add(listScrollPane);
    So I'm not sure if there is a fix to this but I have a JList which is defined as listArea and Vector as listVector and I added a scrollPane to the main panel. Whenever I set a width to the list area, the scrollbar disappears but when I remove the width, it brings up the scrollbar but the size of the listArea is too big

    help please and thank you

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Stu_328 is offline Learning Programmer
    Join Date
    Dec 2008
    Posts
    92
    Rep Power
    12

    Re: JScrollPane with width

    Try setting the size on the JScrollPane object instead of the Jlist.

    HTH

  4. #3
    kishkabear's Avatar
    kishkabear is offline Newbie
    Join Date
    May 2010
    Posts
    5
    Rep Power
    0

    Re: JScrollPane with width

    Try creating the scroll pane with the vertical scroll bar set to always visible. ie new JScrollPane(myList, JScrollPane.VERTICAL...option, JScrollPane.HORIZONTAL...option)

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. JAVA JScrollPane Look and Feel
    By truetaurus in forum Java Help
    Replies: 1
    Last Post: 10-11-2010, 10:47 AM
  2. Using an exact width integer to determine the width of a pointer
    By DarkLordoftheMonkeys in forum C and C++
    Replies: 1
    Last Post: 01-26-2010, 02:56 PM
  3. width()
    By kumamako in forum C and C++
    Replies: 2
    Last Post: 08-03-2009, 02:28 PM
  4. setw vs width
    By kumamako in forum C and C++
    Replies: 4
    Last Post: 08-02-2009, 09:56 AM
  5. Pixel width?
    By wilk3sy in forum Website Design
    Replies: 4
    Last Post: 12-09-2007, 04:26 PM

Tags for this Thread

Bookmarks

Posting Permissions

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