Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3633766
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T00:41:39+00:00 2026-05-19T00:41:39+00:00

I have a JList that shows multiple JPanels on them , i have created

  • 0

I have a JList that shows multiple JPanels on them , i have created a custom renderer that returns a new JPanel.
The JPanels are displayed in the JList but they are not accessible, i cant select them and if i have a button or a text area in it i can not press it.
I want to try if this works in a JList because i want to do further pagination. I managed to get it work by adding panels to a Jscroll pane, but would love to make the JList thing work.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T00:41:40+00:00Added an answer on May 19, 2026 at 12:41 am

    This is the normal behavior of the JList (and JTabel, JComboBox, etc…).

    The JPanel that your custom renderer returns is not added to the Swing hierarchy. Only its paint method is used by the JList, to draw the renderer at the right place. The renderer just acts as a stamp, and what you see in the JList are not components, but images of components.

    This is an efficient way of displaying many components on the screen, without having the overhead of real instantiated components. Note that your renderer can return always the same instance (it’s even preferable).

    See the Swing tutorial for more details.

    If you want the entries of the JList to act like real components, you can do the following. First, use a JTable instead of a JList. A JTable with one column and no header is roughly the same as a JList. Why use a JTable? Because JTable provides Editors. Editors are registered on the JTable, just like Renderers are. An Editor appears generally when a user clicks on a JTable’s cell. The Editor is superimposed over the renderer, and this time it’s a real component. If the Renderer and the Editor components are identical, then the user has the feeling that the JTable’s cells are real components.

    The Swing tutorial has examples for this technique.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a custom cell renderer for a JList which displays a nested JList
I have a JDialog dlg, created by a JFrame frm, that contains a JList
I have this JList that I'm using as the display for System.out . I'm
I'm making a swing based application where I have a JList that periodically get's
I have a JList with items that I want to show two values. Is
I'm working on a project that requires GUI, but I have no experience with
I have made a java GUI program and have added a jList on that
We have a controller where we have a pre-declared JList and JLabel that we
I have Java class with JList and ListSelectionListener: final JList myList = new JList();
i have a simple example of a JList that is getting it's data from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.