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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:03:05+00:00 2026-05-30T03:03:05+00:00

I am developing a standalone application in Java using swing API. I need experts

  • 0

I am developing a standalone application in Java using swing API. I need experts guidance in following scenario.

I have a UI which shows some information of an employee.

There are four Operation in a Menu like add emp, edit emp, view emp,delete emp.

I want to use the same GUI for all four actions.

I designed a class which create GUI for above; I have used Singleton design pattern to construct GUI.

As depending on selected operation; in GUI some componants gets disabled or removed or added more and then GUI gets Constructed and shown to User.

I was thinking of passing a string describing the operation to GUI construncor and then do the above things related to componants.But as I have used the Singleton Design pattern its not possible.

What should I do in above scenario, to complete all my requirement?
Which design pattern you suggest to me for above scenario and as well as for constructing the GUI?

Please guide me experts!

  • 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-30T03:03:06+00:00Added an answer on May 30, 2026 at 3:03 am

    Create an Enum with the operations:

    public enum Operation{
      ADD, EDIT, VIEW, DELETE
    }
    

    And in your GUI create a method:

    public void setOperation(Operation op){
        case ADD: ...
        case EDIT: ...
        case VIEW: ...
        case DELETE: ...
    }
    

    Other option would be to have sort of a GUI inheritance:

    abstract class EmployeeView
    class AddEmployeeView extends EmployeeView
    class EditEmployeeView extends EmployeeView
    class ViewEmployeeView extends EmployeeView
    class DeleteEmployeeView extends EmployeeView
    

    So your abstract class would have the required fields and the subclasses would just enable/disable them.

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

Sidebar

Related Questions

Hai I am developing a standalone application using Java in which I am using
I am developing a standalone application, in Java using NetBeans, that gets and sends
Developing an MVC application, i now need to have test other browser versions. Installed
I am developing a stand-alone java application which uses eclipselink. It is all fine
i am developing a standalone application using html and want to call method residing
I'm developing an application that which will work as a standalone website and will
Developing a heavily XML-based Java-application, I recently encountered an interesting problem on Ubuntu Linux.
Developing a project of mine I realize I have a need for some level
Developing a C# .NET 2.0 WinForm Application. Need the application to close and restart
I am developing an application on the Google App Engine using Python (and Django,

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.