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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:21:51+00:00 2026-05-28T02:21:51+00:00

I think that I have a quite strange question. I am using a class

  • 0

I think that I have a quite strange question. I am using a class -in an already existing code- that was primarily used to open a Save Dialog window. The code that was used is the below:

String savedName;


if (OperatingSystem.isMacOSX()) {
  savedName = showFileDialog(parentView, dialogTitle, contentType, name, true);
} else {
  savedName = showFileChooser(parentView, dialogTitle, contentType, name, true);
}

so what I did is to put it into block comment and now I would like to save the project, by using a different name every time that the class is called. This name will be taken from an array using this code:

int m = 0;

for (HomePieceOfFurniture piece : home.getFurniture()) {
  if (piece.isVisible()) {
         m++;
  } } // A table used to save the names of the furniture and initialize it
String [] Furniture = new String[m];   
m = 0;

for (HomePieceOfFurniture piece : home.getFurniture()) {
   if (piece.isVisible()) {
       // "a" is used to save the name of the furniture piece
       String a = piece.getName();
       Furniture[m] = a;
       //System.out.printf(Furniture[m]);
       m++;
       }
    }

What I want is a tip to find how I can understand how this class is called.

Thanks in advance.

  • 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-28T02:21:52+00:00Added an answer on May 28, 2026 at 2:21 am

    If you want to call the original method (the first snippet) with a filename as a parameter, modify the method to accept an addition parameter called savedName, remove the declaration inside the method, and leave the rest as-is.

    public void someMethod(String savedName) {
        // The commented-out code that used to ask for a filename.
        // if (OperatingSystem.isMacOSX()) {
        //     savedName = showFileDialog(parentView, dialogTitle, contentType, name, true);
        // } else {
        //     savedName = showFileChooser(parentView, dialogTitle, contentType, name, true);
        // }
    
        // Rest of method stays the same.
        File f = new File(savedName);
        // etc.
    }
    

    Then call it from your new code that creates the filename.

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

Sidebar

Related Questions

I have quite a few lines of code that create objects and using various
I have a piece of code that presents an interesting question (in my opinion).
I think that Visual Studio's biggest let down is the Javascript editor. I have
I have a team lead who seems to think that business logic is very
I have a peculiar problem, which I think that a lot of other people
I have a problem drawing something quickly in .NET. I don't think that any
O.K. I think that's an easy one! I have a ViewMasterPage with some links
Having an issue here that I have tried everything I can think of but
I have some data that I have to display as a table. I think
We have objects that we want to represent in stacks (think of stacking items

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.