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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:34:42+00:00 2026-06-18T08:34:42+00:00

I have a program that uses the java swing jframe as my main class.

  • 0

I have a program that uses the java swing jframe as my main class.

It passes the arguments to the jframe which then calls another method from its constructor called populate menus.

This then goes and reads the files that will make upthe menus.

My question is should I create and object that reads in all the files and pass that to my constructor?

Below is what I do now.

I seperate the arguments(these are the config file locations) and then I call the constructor of the jframe which i then pass the values.

public static void main(args[]){

final String isoconfig = args[0];
final String userlist = args[1];
final String equipment_list = args[2];
final String config = args[3];

java.awt.EventQueue.invokeLater(new Runnable() {
 public void run() {
  try{
     new UserInterFace(isoconfig,userlist,equipment_list,config).setVisible     *     (true);;}
  catch(IOException ioe){
      System.out.println(ioe.getMessage());}}
       });}
}

Here is the constructor code

public UserInterFace(String isoList,String userList, String equipment_list, String config)throws IOException  {

   initComponents();
   populatemenus(isoList,userList,equipment_list,config);
   initObjects();}

What I was thinking was to do this

 public static void main(args[]){

 Readfiles configfiles = new Readfiles(args);  

 java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
      try{
          new UserInterFace(configfiles).setVisible(true);;}
      catch(IOException ioe){System.out.println(ioe.getMessage());}}
     });}}
  • 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-06-18T08:34:43+00:00Added an answer on June 18, 2026 at 8:34 am

    For simplicity, maybe it would be better to do just like this:

    public static void main (String [] args)
    {
        new UserInterface (args).setVisible (true);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed a Java Swing application, which uses the SwingWorker class to perform
I have a Java program that uses reflection to find and invoke the main(String[]
I have written a Java program that uses Java swing library. Now I would
I have a program that uses three JTextField fields as the main data entry
I have a program that uses java.util.TimeZone to produce the GMT offsets for various
I am making a java program that uses the interpolation search below I have
I have a java client program that uses mdns with service discovery to find
I have a Java program that uses OAuth for communication with a server to
I have a program that writes a string to a .java file, uses javax.tools
I have this simple Java program that uses Jsch to connect to an SFTP

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.