Creating a 3 tiered model application

Really, what i am looking for here is a bit of advice on the best way to achieve somthing. Lets say i have a class A. In this class i have created GUI code and a few methods at the bottom. In this GUI application i have a text field and a password field. Now the idea is to put my methods into their own class, so that my class A only contains GUI code. But i cant think of the most logical way to do this. At the moment, if i do create a new class for my methods, the process will be:
class A will call the methods class for the submit method.
The submit method will call class A for the inputs in the text and password fields.
class A will send these inputs back to the method in my methods class.
The methods class will carry out this method and the pass back the result to class A.
Seems very back and forth. Whats the best way to deal with a situation like this?

import java.awt.Container;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.awt.*;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import javax.swing.*;
public class Login extends JDialog implements ActionListener
ArrayList personsList;
PersonDAO pDAO;
JLabel userName, passWord;
JTextField userName1;
JPasswordField passWord1;
JButton jbnClear, jbnSubmit, jbnCancel;
String userName2, passWord2;
Container cPane;
public Login(JFrame father) {
super(father);
createGUI();
userName2  = "";
passWord2   = "";
personsList = new ArrayList();
pDAO = new PersonDAO();     
public void createGUI(){
cPane = getContentPane();
setLayout(new GridBagLayout());
//Arrange components on contentPane and set Action Listeners to each JButton
arrangeComponents();
setSize(210,170);
setTitle("Login");
setResizable(false);
setVisible(true);
setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
public void arrangeComponents(){
userName = new JLabel("Username");
passWord = new JLabel("Password");
userName1   = new JTextField(20);
passWord1   = new JPasswordField(20);
jbnClear  = new JButton("Clear");
jbnSubmit = new JButton("Submit");
jbnCancel = new JButton("Cancel");
GridBagConstraints gridBagConstraintsx01 = new GridBagConstraints();
gridBagConstraintsx01.gridx = 0;
gridBagConstraintsx01.gridy = 0;
gridBagConstraintsx01.insets = new Insets(5,5,5,5);
cPane.add(userName, gridBagConstraintsx01);
GridBagConstraints gridBagConstraintsx02 = new GridBagConstraints();
gridBagConstraintsx02.gridx = 1;
gridBagConstraintsx02.insets = new Insets(5,5,5,5);
gridBagConstraintsx02.gridy = 0;
gridBagConstraintsx02.gridwidth = 2;
gridBagConstraintsx02.fill = GridBagConstraints.BOTH;
cPane.add(userName1, gridBagConstraintsx02);
GridBagConstraints gridBagConstraintsx03 = new GridBagConstraints();
gridBagConstraintsx03.gridx = 0;
gridBagConstraintsx03.insets = new Insets(5,5,5,5);
gridBagConstraintsx03.gridy = 1;
cPane.add(passWord, gridBagConstraintsx03);
GridBagConstraints gridBagConstraintsx04 = new GridBagConstraints();
gridBagConstraintsx04.gridx = 1;
gridBagConstraintsx04.insets = new Insets(5,5,5,5);
gridBagConstraintsx04.gridy = 1;
gridBagConstraintsx04.gridwidth = 2;
gridBagConstraintsx04.fill = GridBagConstraints.BOTH;
cPane.add(passWord1, gridBagConstraintsx04);
GridBagConstraints gridBagConstraintsx09 = new GridBagConstraints();
gridBagConstraintsx09.gridx = 0;
gridBagConstraintsx09.gridy = 4;
gridBagConstraintsx09.insets = new Insets(5,5,5,5);
cPane.add(jbnClear, gridBagConstraintsx09);
GridBagConstraints gridBagConstraintsx10 = new GridBagConstraints();
gridBagConstraintsx10.gridx = 1;
gridBagConstraintsx10.gridy = 4;
gridBagConstraintsx10.insets = new Insets(5,5,5,5);
cPane.add(jbnSubmit, gridBagConstraintsx10);
GridBagConstraints gridBagConstraintsx11 = new GridBagConstraints();
gridBagConstraintsx11.gridx = 1;
gridBagConstraintsx11.gridy = 5;
gridBagConstraintsx11.insets = new Insets(5,5,5,5);
cPane.add(jbnCancel, gridBagConstraintsx11);
jbnClear.addActionListener(this);
jbnSubmit.addActionListener(this);
jbnCancel.addActionListener(this);
public void actionPerformed (ActionEvent e){
if (e.getSource() == jbnClear){
clear();
else if (e.getSource() == jbnSubmit){               
Submit();
else if (e.getSource() == jbnCancel){               
cancel();
String getUsername() {
return userName1.getText();
String getPassword() {
return new String(passWord1.getPassword());
public void Submit(){
userName2 = getUsername();
passWord2 = getPassword();
PersonInfo person = new PersonInfo(userName2, passWord2);
if(userName2.equals("") || passWord2.equals("")){
JOptionPane.showMessageDialog(null, "Please complete all fields.");
else
pDAO.loginPerson(person);
public void clear(){
userName1.setText("");
passWord1.setText("");
personsList.clear();
public void cancel(){
this.dispose();
}At the moment i am concentrating on the Submit method. I create a new class for it and pass the class all references to other classes i need to use.
import java.util.ArrayList;
import javax.swing.*;
public class LogRegMethods
JFrame jf = new JFrame();
ArrayList personsList = new ArrayList();
PersonDAO pDAO = new PersonDAO();
Login log = new Login(jf);
String userName2, passWord2;
public void Submit(){
userName2 = log.getUsername();
passWord2 = log.getPassword();
PersonInfo person = new PersonInfo(userName2, passWord2);
if(userName2.equals("") || passWord2.equals("")){
JOptionPane.showMessageDialog(null, "Please complete all fields.");
else
pDAO.loginPerson(person);
}An then i change my Login class by adding
          LogRegMethods lrM = new LogRegMethods();and
     else if (e.getSource() == jbnSubmit){               
                   lrM.Submit();
             }See, its just very back and forth. I am trying to understand what happens to JTextFields at runtime. The way i have it at the moment, it frezzes when i click on the Login button. I just need advice on how i can clean it up.

Similar Messages

  • I have a MacBook Pro , Model Identifier MacBook Pro8,2 , MAC OX S 10.7.4 I noticed that if I open Final Cut Projects created on other/older models MacBook Pro Laptops or MacPro Desktops, the fonts used in the previously created FCP projects, change their

    I have a MacBook Pro , Model Identifier MacBook Pro8,2 , MAC OX S 10.7.4
    I noticed that if I open Final Cut Projects created on other/older models MacBook Pro Laptops or MacPro Desktops, the fonts used in the previously created FCP projects, change their font spacing! which distorts the look of the Text that was written, by oevrlapping on other things that were put & present on the screen.. Another similar probelm is that the Vector shaped used for example to highlight certain words or shapes, also change their position on the screen so that they no longer highlight exact things that we once used these vectors to highlight or outline... Anyone knows how to solve this problem please?? I made sure that the same fonts are available in the Library in both old and newer computers...
    thanks in advance..

    You might want to take your question to the FCP forum - if you copied all fonts to your Library>Fonts folder and restarted they should be recognized by all applications. I know that this works for Adobe products, anyway.
    Clinton

  • How to Create Listbox in a JSP Application

    Hi.
    I'm new to JDeveloper. Can someone show me how to create a Listbox (that gets it's values from a database table) in a *.jsp form? This listbox is linked to a database table field. I'm not using BC4J nor EJB. I've created a JSP application with ADF using a Model1 (or MVC pattern) architecture -- which I based on the JDeveloper10i tutorial (http://otn.oracle.com/obe/obe9051jdev/ADFmodel1/ADFmodel1.htm). I've tried using render on the field in the view object entity, refresh the Data Control Palette and then drag the table view entity to a *.jsp page as input form. But I can't see the field in the form being displayed as a list box.
    Please help.
    thanks,
    christina

    Hi Shay.
    Thanks for the quick reply. Sorry for the misuderstanding but I have no clue on terminology used in JDeveloper. The "view object" entity I was referring to is the "<TableName>View" view object (e.g. EmpView) under the Model->Application Sources->Mypackage folder where the "<TableName>" entity object file also resides. I think I'm using the Business Component bec. I have this step in the tutorial that I based my application on.
    I have trouble following the tutorial link you gave me (for the ADF Business Component Popup list) bec. when I select the table field in the "Data Control Palette" Panel, the only values I see in the "Drag and Drop As" poplist are "Value","Label","RenderValue" and "Input Render". I can't see the type "Single Select List". Do you why is that?
    thanks,
    christina

  • Why we need Custom controllers in Model Applications

    Hi Friends
    In Adaptive RFC Model Application we can use both the controllers for creating contex structure
    wat is the main aim for using custom controller
    it has any special feature in custom conrollers
    i read both the controllers have same functionality n flexibility
    any body differentiate these two controllers
    n which one is efficient for connecting Model applications
    Regards
    Narayana

    Hi Narayana,
    There are many situations when you need custom controllers over component controller.
    Suppose you have one DC and you want to make some part of this DC as Public which may include Local context nodes, elements, methods or model context with specified methods to process some functionality. By Interfacing a custom controller with all the exportable methods and context you reach to a certain level of security.
    In this case you are distributing your module in multiple custom controllers which ultimately reduces complexity of programming, code and obviously execution time.
    This is up to  the developer, if he/she wants to create custom controllers or not, but yes in certain situations you should go for custom controllers. It is always good to have multiple custom controllers when you are using single DC for different modules.
    Regards,
    Amol

  • SAP Enterprise Modeling Applications by IDS Scheer (ARIS)

    Hi,
    Does anyone know where to find the temporary license key for SAP Enterprise Modeling by IDS Scheer?
    The documentation in the Service Marketplace directs you to the "download scope" - however I cannot find anything in the download software or in the download license keys areas of the Service Marketplace.
    Thanks

    IDS Scheer's ARIS (offered also by SAP as "Enterprise Modeling Applications") let's you create, communicate and maintain conceptual models of your organizations processes. They primary serve as 'live' documentation and focus on high level, company wide processes (e.g. "the procurement process").
    NetWeaver BPM and the included process composer tool let's you model executable process extensions to SAP applications and run them as composite applications. You would use them to e.g. implement approval, collaboration, exception management, workflow etc.
    Now both modelers work with "boxes and arrows" type of models, but their intent is different and they're usually applied by different people for different purposes.

  • Design Model applications?

    The last step in creating a new application has a checkbox with "Save this definition as a design model for reuse" next to it. I could not see an explanation of "design model" in the HTML DB user's guide or on the Internet.
    Questions
    1) Does this mean you can have one or more template applications to speed up the development of new application?
    2) How do you change an application from not being a Design Model to being one? I created a template application without marking it as a Design Model. How can I make it one? I have the application export, but when I import it, I cannot designate it as a Design Model application.
    3) In the past I created some "test" applications with the checkboxs checked. I have since deleted these "test" applications, but they are still in the list of Design Model applications. How do I remove them from the Design Model list?
    Mike

    Mike,
    When you use the create application wizard, then the page definitions of the pages you’re adding to your application are saved as a model. So all the information about your form pages, report pages, tabular form pages, and if selected, your analysis pages, are all saved if you choose that option. When you use the create application wizard the next time, you will be able to re-use that application definition, perhaps modify it, add new page definitions, change existing page definitions, etc. And then you can create a new application based on that updated model. You can not go back to a model to modify an existing application, nor can you create a model for an application that previously didn’t have one.
    Please note that a model only stores information about your pages. Your other selections, like what theme you want to use, if you want to copy over any shared components, what kind of authentication you want to use, etc. are not stored in the model. So if you want to save a full application for future re-use, it’s best to export it, or create copies of the application.
    In order to delete an application model, you can go to your application administration, then click on manage service and go to application models. There you’ll find a list of models and a button to delete those that are no longer needed. Deleting a model has no effect on any existing applications.
    Regards,
    Marc

  • Where to create and maintain rule modeler

    Hi Experts,
                       Where can I create and maintain Rule Modeler to set up ERMS, and kindly provide what are the steps required to maintain rule modeler. thanks
    Regards,
    Lakshmana.P

    Hello,
    It depends a little on the CRM release you are using. In older versions of CRM up to CRM 5.0, the Rule Modeler is accessed from the Netweaver (Enterprise) Portal via the IC Manager role (though it can also be launched directly using the BSP application from SAP GUI). In CRM 2006s/CRM 2007 and CRM 7.0 the Rule Modeler is available in the CRM WebClient from the IC Manager business role. It's located under the menu heading, "Process Modeling".
    Best regards,
    John

  • "You can't restore this backup because it was created by a different model"

    I've been using TM from my Mac Mini to Macbook extensively due to my remote locations and due to the fact that i am always on the run and need to have same apps in both computers. Now after having no probs and fully satisfied with my apple products i stumbled into this: "You can't restore this backup because it was created by a different model of mac". Can someone explain me how on earth did this happen after all these times?? Any suggestions? What are my alternatives?
    I tried the superduper image but image of my Mac Mini contains different system info from the Macbook componenets i guess, since they use different installation discs. In the end of the day i guess i will have to use the install dvd and then the migration assistant, but why did TM Restore failed me so much?

    I can only assume you tried restoring an entire system thus causing the error to avoid installing a Mini system on the MacBook or vice-versa. Transferring an application shouldn't bee a problem, but restoring the entire OS would be.
    It isn't clear exactly what you need to do, but my assessment is that you should be using a different utility such as one of the following:
    Backup Software Recommendations
    Backuplist
    Carbon Copy Cloner
    Data Backup
    Deja Vu
    iBackup
    JaBack
    Silver Keeper
    MimMac
    Retrospect
    Super Flexible File Synchronizer
    SuperDuper!
    Synchronize Pro! X
    SyncTwoFolders
    Synk Pro
    Synk Standard
    Tri-Backup
    Others may be found at VersionTracker or MacUpdate.
    Visit The XLab FAQs and read the FAQ on backup and restore. Also read How to Back Up and Restore Your Files.

  • Error while creating a new Dimension/Model in BPC 10.0 NW

    Hello Experts,
    I am using BPC 10.0 NW system.
    When I try to create new Dimensions or Models I get the following Error Message.
    "Error in Admin module or a component used by Admin module.
    Failed to create SAP NetWeaver BI InfoObject for dimension."
    I am assigned to all the needed task profiles to create Dimensions and Models.
    Please assist me to resolve this issue.
    Thanks & Regards,
    Archana

    Thanks Roberto.
    The error was coming because while creating the user id "SAP_ALL" Profile was not assigned. So I was not able to create Dimensions and models.
    Now the issue is solved.

  • Source code for "Creating an Extended Web Dynpro Application"?

    Hello!
    I'm a rookie in the field of SAP Netweaver and I'm justing getting started with some tutorials. My problems with "Creating an Extended Web Dynpro Application" are to massive to be posted on this forum in this stage. What I want to have some help with is to find the source code for that tutorial so I can get som guidence from there.
    Following text is cut out of this page:
    http://help.sap.com/saphelp_nw70/helpdata/EN/5d/f42fef2eec724597a03b6bcc670c2c/frameset.htm
    Creating an Extended Web Dynpro Application
    You can download the Web Dynpro project for the current tutorial from the Software Developer Network SDN (http://sdn.sap.com -> Web Application Server -> Web Dynpro -> Sample Applications and Tutorials) in two versions: one skeleton version you can use for exercises and one final version (solution) for an immediate build, deployment and run on the Java engine of the SAP Web Application Server.
    How hard I try I can't find the specific source code on sdn.sap.com
    Does anyone have a clue where it is?
    Thanks!
    Best regards
    /Johan Månsson Lindströ

    Hi!
    I did what you said but I seem to miss the IDE folder. This is what it looks in my Explorer
    C: > Program Files > SAP > IDE > CE > eclipse > (no folder called "examples")
    I also did a search in this eclipse folder for "examples" but I did'nt find the example I'm looking for
    I am running a newer version of NWDS:
    SAP NetWeaver Developer Studio
    SAP NetWeaver 7.1 Composition Environment SP03 PAT0000
    Maybe that's why things don't look the same?

  • I want to create home page for my application with short URL

    I want to create home page for my application with short URL
    as when I want user to use my application user must go to URL like this
    http://127.0.0.1:7101/My-Project/faces/app/empModule/allEmployees/viewMyEmployees.jspxI want the user to use short URL , How can I use shorter URL not all this one.
    I want shorter URL for my application not to write full path .
    thanks in advance.
    Edited by: user611775 on Oct 31, 2010 10:21 PM

    Well,
    it's up to you. The first part (Mcit-Project-ViewController-context-root) is the context root which you define in the view controller project. 'faces' is the name the servlet filter reacts on. You can't omit it but shorten it in web.xml. The rest is your directory structure. I'm not sure how to shorten this other as to move the jspx files back into the web root folder.
    By the way an ADF faces app never uses the .jspx at the end of the url. If you specify '.jspx', you only render the page but don't start the work flow.
    Timo

  • How to create the user on Internet Application Server(IAS) control console

    Hi All,
    My Client is asking me for How to create the user on Internet Application Server(IAS) control console 10.1.2( 10g release 2).
    If anyone have the document for How to Create the User on Internet Application Server (IAS) console 10g release 2 , then please send me the document and help me out from this Concern.
    Regards,
    Yadav@intelli.
    Edited by: 851080 on Apr 8, 2011 6:31 PM

    Are you using OID? Can you provide more details about your iAS environment?

  • How to create a account key for application type M ?

    Hi Guys,
    How to create a account key for application type M ? and link the same with
    Gl account.
    thanks.

    Hi
    Please create the account keys or transaction keys in
    SPRO-> IMG-> MM-> Purchasing-> Conditions-> Define Price Determination Process-> Define Transaction/Event Keys
    Thanks & Regards
    Kishore

  • I'm wondering if there is any way to view the results of the form other than in a spreadsheet?  Is it possible to print responses one by one in PDF format, or word, etc?  I'd like to create a form for proposal applications, and the spreadsheet format resu

    I'm wondering if there is any way to view the results of the form other than in a table?  Is it possible to print responses one by one in PDF format, or word, etc?  I'd like to create a form for proposal applications, and the spreadsheet format results are nearly unusable for this type of form.

    Hi Nalani500 ,
    Yes, you can print the response in a PDF by following the steps suggested below.
    1) Go to the response file
    2) Select the response you want to print
    3) Click on Save as PDF button and it would save the selected response in PDF format.
    Thanks,
    Vikrantt Singh

  • Error while Creating Prestage Content File for Application in SCCM 2012

    Hi All,
    I am using SCCM 2012 SP1 on Win 2K8 SP R2 box. Database is SQL 2008 R2 SP1 CU6. I have trying to create Prestaged content for Applications for extracting pkgx files on DP's. I am getting the below error message for random applications(not for all applications
    but for random applications).
    Content that will be included into the prestaged content file (1):
    Citrix Receiver 13.3.0.55
    Export all dependencies: 'Yes'
    Selected distribution points: 'MPSERVER.GS.WORLD.PRESS.COM'
    Prestaged content file: 'G:\pkgxfiles\Application\Citrix Receiver 13.3.0.55.pkgx'
     Error: Distribution is currently in progress for selected packages: HM0000D9. Please wait and try again
    But if I see this application is successfully distributed to 2 of the distributions points long ago. If I reupdate the Distribution point and then again try to create prestaged content for this application then pkgx file for that application is getting
    created.
    Why this is happening and how can I resolve this?
    Thanks & Regards Uttam

    Since no one has answer this post, I recommend opening  a support case with CSS as they can work with you to solve this problem.
    Garth Jones | My blogs: Enhansoft and
    Old Blog site | Twitter:
    @GarthMJ

Maybe you are looking for

  • The Web application could not be found

    Hello, I have a machine that has s share point portal . I create WCF on the same machine and set it on IIS and the identity of application pool is the administrator of machine            PlatformTarget : 64 bit ,  Framework : .net 4.5 I have added sh

  • Status bar of Oracle from runtime applet is not displaying all of a sudden

    Hello, The status bar of Oracle form runtime applet is not displaying all of a sudden..It was displaying before but now its not......It helps me to see errors......how can I restore it?

  • How to open with only level-one bookmarks showing

    I know how to set my initial view so the Bookmarks pane is open. However, is there a way to set the level of bookmarks that are shown? I have created my PDF by merging a lot of smaller files, many of which were created from MS Word, so there are many

  • What is Personal change request

    Hi experts ,                     I want to know about much talked Personal change request . Ans speically when its required to use it. If you have any informational link about it kindly tell me. Regards Abhay

  • Zen Micro - Can it be used in the ca

    Hello, I have a Zen Micro and wondered if there is any way that it can be used through a conventional car cd player (as the Ipod can). Any ideas ? Cheers.