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 4249156
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:21:34+00:00 2026-05-21T04:21:34+00:00

I want to open a configuration screen and send back its data when user

  • 0

I want to open a configuration screen and send back its data when user clicks ok.

I have these objects as configurations

configObjA a;  
configObjB b;

Both implement IDisplayable (my interface).
Now the congfig screen gets two ArrayLists and put them in JLists gui.
it itterates the JList and put them in datamodel.

when I return from the screen , I want to send the main screen the results.
So I re-iterate the datamodel and put it all back in an arraylist

the problem is the main screen doesnt know anything about
Is there a way my configuration screen would return a type that the main screen will know?

I thought of returning
public List getOptionsList()
and in the method I wil create a list of the type I sent. (I would then have to keep the type i sent ). is that any good? how do i create a generic list when the type is of unknown
object type? any suggestion ?

btw: isnt my foolish gui process too complicated for that simple need?

  • 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-21T04:21:35+00:00Added an answer on May 21, 2026 at 4:21 am

    how do i create a generic list when the type is of unknown object type?

    You cannot. The whole point of generic lists is that you do know the object type at compile-time, so that the compiler can check your usage of that list.

    If you know at least a parent class or interface (which is the usual case actually), you can use that:

    List<IDisplayable> l;
    

    If it can be any type of object, you can only say

    List<Object> l;
    

    which will accept any kind of Object, but removes the potential for meaningful compile-time type checking.

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

Sidebar

Related Questions

I want to open a save file dialog, have the user enter a filename,
I want to open a TCP client socket in Python. Do I have to
I want to open a file dialog box in user control. I used using
I have a code base which I want to push to GitHub as open
I want to open a file for reading, the C++ way. I need to
I want to open a folder window, in the appropriate file manager, from within
I want to open and manipulate Excel files with ActiveX. I've had success with
Suppose I want to open a file in an existing Emacs session using su
If you want to open an msg Email file with the extension .msg, Outlook
I use Perforce for source control at work and I want to 'open for

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.