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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:16:30+00:00 2026-06-11T00:16:30+00:00

I try to create one MVC Application with Swing. And I am confused with

  • 0

I try to create one MVC Application with Swing. And I am confused with the implementation and how things should be. What i mean is:

  1. I have the Gui which is the view all the logic send to a class named controller and I have a model where I have model properties.(I have read MVC is like that)

  2. I create some Random codes in view with input of how many codes I want and transfer this with ActionListener to a Class Named Controller. The Random codes generated with a button on the controller class in a method .
    The random codes are generated and then i want to save them on a database.
    I am confused how to save the generated codes on the database.
    Should i create a method in the Class Named Controller so that i can save them from there? Or another different class with save update find………. methods? If Yes then why I have create the Model class with Model properties? And how can I use the Model class.
    what is only left to understand how to use the Model class if I have to use it or if I just have to have this class so that is there. What is the use of Model class if it’s only to be there with the properties and do save some where else?
    What approach is usually used so that I am ok with MVC pattern? Am I confused? Any help
    I forget to tell that I use Hibernate.
    thanks
    ps. I have also read this http://java.sun.com/products/jfc/tsc/articles/architecture/ but i didn’t understand it.

    public class code(){// this is the Model
        private int i;
        public void setter(int i){
            this.i=i;
        }
    
        public int getter(){
            return i;
        }
    
        public String generateStringInt() {
            return new BigInteger(190, random).toString(32);
        }
    
        // what ever i want to create with the int i variable i will do it on this class?
        ///then i will pass it on the controller to sent it on the view  
        //OR save if i want to save it.?Is this way of thinking right?
        //Or is there any other way to do it ?
        /// if i have a Button and press it from the View it will generate this method?or
        // i have to do it else?
        public String generateStringInt() {
            return new BigInteger(190, random).toString(32);
        }
    
     }
    
     //then if i want to save i can just do it like 
     //session.save(object) or is there any other way?
    

is it better now ?
Thanks

  • 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-11T00:16:32+00:00Added an answer on June 11, 2026 at 12:16 am

    Hi there i have the same problem with here is a tutorial very simple to use and understand what’s all about

    http://www.leepoint.net/notes-java/GUI/structure/ui-model-communication.html

    then this

    http://www.leepoint.net/notes-java/GUI/structure/30presentation-model.html this is the best approach i think.

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

Sidebar

Related Questions

I have created a Razor view in my asp.net MVC 3 application. It is
I have a wizard in my asp.net MVC application which is built upon this
I have a controller which renders a view (~/Views/Component/Create.aspx) no problem. When this view
I try to create a simple heroku app which clones a git repository, invokes
I try to create the simplest WinAPI window using assembly NASM. I have problem
For practicing purposes, I’m about to create a new ASP.NET MVC 3.0 application. My
Here's my situation: I have been working on an ASP.NET MVC 3 application for
I'm building a new ASP.NET MVC application (in C#) and one of the requirements
I have an ASP.NET MVC web application that makes REST style web service calls
I am prototyping a web application using Spring MVC 3.0 with JasperReports. I have

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.