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

  • Home
  • SEARCH
  • 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 6073431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:16:12+00:00 2026-05-23T10:16:12+00:00

I am creating a program which should be able to open different perspectives .

  • 0

I am creating a program which should be able to open different perspectives. Perspectives, in my program, mean different layouts of the controls. The user is able to create and pick which perspective they want to use. There is also a Default Perspective. The Default Perspective can be chosen.

Because of this I do not know how many perspectives there are, or what the Default Perspective is. My program uses engine.perspective to Read and Write to the text file (Perspective.TXT) in which the all the perspectives are stored. When the user creates a perspective my program automatically makes a *.JAVA file with all the perspective data. This is my code for reading Perspective.TXT and calling the correct type:

    ArrayList<String> ALLPRSPCTVE = Read.getAllPerspectives();
    String PRSPCTVE = Read.getDefaultPerspective();

    {
        String[] ARR = (String[]) ALLPRSPCTVE.toArray();
        for (int i = 0; i < ALLPRSPCTVE.size(); i++) {// Set All Perspectives
            if (PRSPCTVE == ARR[i]) {

            }
        }
    }

How do I change the String returned from the method Read.getAllPerspectives to something JAVA will recognize as a type and go to it?

  • 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-23T10:16:13+00:00Added an answer on May 23, 2026 at 10:16 am

    You have a software architecture problem.

    But, if you want to do exactly what you say, you can still make it possible, even though it’s not the right way.

    • you have to call the java compiler to transform your java file into class file
    • and then you can use reflection to load dynamically a class (using Class.forName)
    • and finally instanciate this class to get a new object whose methods can be used, which would be much easier if you had a common interface for all those classes.

    But, please don’t do that and go on reading.

    Alan Turing introduced modern computer at the middle of the 20’s century. One of its main features is that it dissociates data from code.

    Data is the a part of memory containing variables and code is a set of instructions that manipulates those data (and other creating during programs’s lifes. In java, program/code is written inside classes).

    Data can then be divided into two different support : dynamic, fast and volatile memory (modern RAM) and long term storage (hard disk/database).

    Note that code is data. It has to be saved on disk, loaded in memory, but it is executed. Simple data is not executed, it’s mere data, read and written but not executed.

    This has very practical impliactions for all applications, and you application is violating his separation of data and code has you use code (java classes) to memorize data.

    Here is what you should do :

    • save your data in a format that has nothing to do with java. For a simple format in which fields have values, you could use a property file (tutorial here). This will be your long term storage solution.
    • Then try to wrap together all functions related to reading, manipulating and writing those properties in a separate class, with public methods that your other classes will be able to call to have access to this data.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a utility program which draws some (user customizable) icons onto other windows
I am creating a test program to test the functionality of program which calcultes
I am creating a program that needs to store the user's data in encrypted
I have been tasked with creating a program what will create take files in
I am creating an ASP.NET application in which the administrator of the program will
Just out of curiosity, if I am creating a program installer, how should I
So I've been working on program in which I'm creating a hash table in
I am creating a program which can send test or data to Bluetooth devices.
I am creating a program that will be installed using the .net installer project.
Let's say I'm creating a program in C that needs to use a tempfile.

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.