Java dispose versus hiding

Hi,
I am working on a desktop application , where in I want to call a different Java Form class when a user presses a button. Details are as follows
2 classes
1.MainPage ( JForm Class)
2.Transaction Page (JForm Class)
Events :
1. Startup --> MainPage--> Initialize & Connect DB--> Show Menu etc.
2. MainPage.closeButton --> Trigger -->Create new Transaction Class --> dispose MainPage--> Show TransactionClass
3. TransactionClass.closeButton --> Trigger --> Create new MainPage Class--> Dispose itself--> Show Mainpage
I am using Netbeans for development and Derby as embedded database for a small application. My question is whether the process above is the preferred/suggested method to show & hide classes. Everytime I am disposing and creating MainPage it creates new conenction . Everything works perfectly fine without any glitches or issues, but I would like to know if there are any best practices when it comes to such scenarios. Please share your thoughts/experiences.
Vivek

user10591400 wrote:
Thanks for suggestion. Any thoughts on whether it is advisable to keep the previous form in memory , whether it slows down anything or not ? Although my form is very light but just curious :)Again, just given what you've told us, if you are creating and discarding transaction pages, from a single main page, it is very unlikely you are going to have performance or memory issues (unless your transaction uses algorithms with exponential time/memory requirements).
¦ {Þ                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Java Desktop versus Enterprise client

    What is the difference between Java Desktop Application versus Enterprise Applciation client?

    Desktop Applicatoin is local to your computer, it may have connections to the network, such as MS-Word will connect to the internet for updates and help files.
    An Enterprise Application is developed on multiple tiers--local clients, web servers, data servers, and etc. Processing done in an enterprise Applicatoin is distributed amoungst the different tiers.

  • Java BluePrints versus Jakarta

    I created a new Visual Web Pack Application, for source structure I chose Jakarta (the other option is Java BluePrints), because I am going to deploy my application in Tomcat 5.5.17. For server I obviously chose Tomcat 5.5.17.
    Also, I added the BluePrints AJAX components 0.1.1 to the component libraries of my project.
    However when I wanted to drag an Auto Complete Text Field on one of my project's page this turned out to be impossible. I guess because I chose Jarkarta as source structure instead of Java BluePrints.
    Does anyone know how to solve this problem?
    What are the consequences of choosing Java BluePrints as source structure when you want to deploy in Tomcat?
    Thanks,
    Annet.

    Well, the String.replaceAll(String, String) method uses the Java regexp internally, and I'm not sure there's a way to change that. So that at least is one place that will use it. I don't know for sure, but Jakarta's ORO is supposed to be fully compatible with Perl 5, and also supports other regexp types as well, so if you need that aspect of it, then go with Jakarta. I heard some of Java's are a little limited in some capabilities. I can't find any particular pages that refer to any comparisons of them at to compare runtime performance.

  • Java techlogies versus PHP

    Hello,
    we will have big web project. And now I must choise techlogies. All projects were create with PHP.
    Now I think change technology, because I think PHP will small for this project. This project can have more that 1000 users one time. This site will have chat system, and users will often make requests.
    Can I say, what Java will be better decision in this project?
    Can you give examples where Java better in big projects?
    I think about servlets and EJB.
    I will be grateful for answers.

    PHP or Java?
    The basic difference between Java and PHP is that with Java you can have actual object model underneath - n-tier application. That comes handfull when you handle a lot of users and various datasources.
    Another thing is that with use of object models like EJB or COM+, .NET you can use transaction framework already built into the system or object pooling (Here maybe I can mention connection pooling - in PHP I think each page opens its own connection (In java the same connection can be used by many clients)). I won't mention the separation od data and business logic in this level.
    In general you also can test the whole application, which I'm not sure if you can with PHP.

  • Java technology versus VB

    Hi,
    I am deciding whether i should develop my next application using Java or VB. It will be like another version of MusicMatch but without all the fancy features. This application's primary task will be to send out a file, through a USB (or midi) port onto a device.
    I am famaliar with both languages but obviously an amatuer. Does anyone have any suggestions or preference they can share with me?
    Much Thanks,
    Jimmy

    "Being able to clicking on an icon to start the program, without needing to install a Java virtual machine first."
    Well, if the program is written in .NET then they would need the .NET framework to run the application. But i see your point, is there anything besides the fact that it is a Microsoft OS for a program written in VB to RUN?
    Ultimately, this application will cross over to the MAC platform. But if i told you that that wasn't my concern...It would be great to kill two birds with a single stone.
    So if i told you that i only had to get this application done and done well in a Microsoft OS and let somebody else worry about the MAC said, would it be unanmious to say that VB WOULD WIN?
    thanks

  • Java class versus Bean

    In terms of implementation, what are the main differences between an ordinary class and a bean? Also,can we use an ordinary class for JSP pages in "useBean:" ?

    In terms of implementation, what are the main
    differences between an ordinary class and a bean?Beans have getter and setter methods while a class might not have them
    Also,can we use an ordinary class for JSP pages in
    "useBean:" ?yes you can. try it out
    npaila

  • Java Swing versus UIX

    Hi All,
    I am new to Orackle UIX.
    could anyone please help me in understanding the difference between
    UIX and Swing.
    Can i get somewhere the comparitive study between these two technologies.
    can i use UIX for desktop applications?
    -Anurag

    UIX is replaced by ADF Faces see this doc:
    http://www.oracle.com/technology/products/jdev/collateral/papers/9.0.5.0/adfuix_roadmap/adfuix_roadmap.html
    For more about ADF Faces see this site:
    http://www.oracle.com/technology/products/adf/adffaces/index.html
    For more about binding read the ADF Developer Guide and tutorial:
    http://www.oracle.com/technology/products/adf/learnadf.html

  • SQL Developer load Java error

    Hello, I'm trying to load Java code to my Oracle SQL developer. On Load java, I choose Java source from my hdd (from NetBeans destination folder) and I get the below error. Any help?
    error code:
        Error in Source Code 
        &Exception in Stack Trace 1 of 1 
        java.sql.SQLSyntaxErrorException: ORA-24344: success with compilation error 
        ORA-06512: at line 1 
            at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:447) 
            at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396) 
            at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879) 
              ......  here is the code. It works well in NetBeans and I'm trying to load it in SQL Developer in .java file
    package c2_01_signhelloworld;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.security.GeneralSecurityException;
    import java.security.KeyStore;
    import java.security.PrivateKey;
    import java.security.Security;
    import java.security.cert.Certificate;
    import org.bouncycastle.jce.provider.BouncyCastleProvider;
    import com.itextpdf.text.DocumentException;
    import com.itextpdf.text.Rectangle;
    import com.itextpdf.text.pdf.PdfReader;
    import com.itextpdf.text.pdf.PdfSignatureAppearance;
    import com.itextpdf.text.pdf.PdfStamper;
    import com.itextpdf.text.pdf.security.BouncyCastleDigest;
    import com.itextpdf.text.pdf.security.DigestAlgorithms;
    import com.itextpdf.text.pdf.security.ExternalDigest;
    import com.itextpdf.text.pdf.security.ExternalSignature;
    import com.itextpdf.text.pdf.security.MakeSignature;
    import com.itextpdf.text.pdf.security.MakeSignature.CryptoStandard;
    import com.itextpdf.text.pdf.security.PrivateKeySignature;
    public class C2_01_SignHelloWorld {
        public static final String KEYSTORE = "C:/Users/myFile/Documents/itext/2/ks";
        public static final char[] PASSWORD = "password".toCharArray();
        public static final String SRC = "C:/Users/myfile/Documents/itext/2/unsigned1.pdf";
        public static final String DEST = "C:/Users/myfile/Documents/itext/2/unsigned1_signed.pdf";
        public void sign(String src, String dest,
                Certificate[] chain,
                PrivateKey pk, String digestAlgorithm, String provider,
                CryptoStandard subfilter,
                String reason, String location)
                        throws GeneralSecurityException, IOException, DocumentException {
            // Creating the reader and the stamper
            PdfReader reader = new PdfReader(src);
            FileOutputStream os = new FileOutputStream(dest);
            PdfStamper stamper = PdfStamper.createSignature(reader, os, '\0');
            // Creating the appearance
            PdfSignatureAppearance appearance = stamper.getSignatureAppearance();
            appearance.setReason(reason);
            appearance.setLocation(location);
            appearance.setVisibleSignature(new Rectangle(36, 748, 144, 780), 1, "sig");
            // Creating the signature
            ExternalDigest digest = new BouncyCastleDigest();
            ExternalSignature signature = new PrivateKeySignature(pk, digestAlgorithm, provider);
            MakeSignature.signDetached(appearance, digest, signature, chain, null, null, null, 0, subfilter);
        public static void main(String[] args) throws GeneralSecurityException, IOException, DocumentException {
            BouncyCastleProvider provider = new BouncyCastleProvider();
            Security.addProvider(provider);
            KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
            ks.load(new FileInputStream(KEYSTORE), PASSWORD);
            String alias = (String)ks.aliases().nextElement();
            PrivateKey pk = (PrivateKey) ks.getKey(alias, PASSWORD);
            Certificate[] chain = ks.getCertificateChain(alias);
            C2_01_SignHelloWorld app = new C2_01_SignHelloWorld();
            app.sign(SRC, String.format(DEST, 1), chain, pk, DigestAlgorithms.SHA256, provider.getName(), CryptoStandard.CMS, "Test 1", "Ghent");
            app.sign(SRC, String.format(DEST, 2), chain, pk, DigestAlgorithms.SHA512, provider.getName(), CryptoStandard.CMS, "Test 2", "Ghent");
            app.sign(SRC, String.format(DEST, 3), chain, pk, DigestAlgorithms.SHA256, provider.getName(), CryptoStandard.CADES, "Test 3", "Ghent");
            app.sign(SRC, String.format(DEST, 4), chain, pk, DigestAlgorithms.RIPEMD160, provider.getName(), CryptoStandard.CADES, "Test 4", "Ghent");

    Hi,
    This could be one of those cases where using Java 7 versus Java 6 makes a difference, or perhaps there is some conflict with the JDBC driver version. So, a few things to try...
    1. Make sure your installation's SetJavaHome line in ...\sqldeveloper\sqldeveloper\bin\sqldeveloper.conf points to a Java 6 JDK.
    2. If (1) does not work, also uncheck the Use OCI/Thick driver box in Tools -> Preferences -> Database -> Advanced.
    3. If (1) and (2) do not work, also copy the ojdbc6.jar from any Oracle client you might have installed to your installation's ...\sqldeveloper\jdbc\lib directory
    I would think doing just (1) should be sufficient. If on Mac OS, use sqldeveloper-Darwin.conf instead.
    Hope this helps and please post back here and let us know, one way or the other,
    Gary
    SQL Developer Team

  • How to re-show a dialog with the parent window

    I am writing an Menu drivern application:
    -- A JCMDIPane is put in the JFrame.
    -- Multiple JCMDIFrames are added to the JCMDIPane via menu selecting events
    -- Each JCMDIFrame (call it parent) may pop up a Dialog window (child) (Thes dialogs are modal)
    Here is my problem:
    When you switch away from this Java application to other applications (reading mauls, editing word documents, surfing web), of course, the Java program is hiding behind these applications and only left a Icon on your taskbar. The problem is that when switch back from other application to this Java program, However, it only shows the parent window (the JCMDIFrame ) and the child (the dialog) is behind. You have to using Alt_Tab to get the focus on the child and show it.
    My question is:
    Is there any way can we show the Dialog window is on the parent window (as it originally shown)?
    I have tried to overwriting the paint method of JCMDIFrame :
    public void paint(Graphics g)
    super.paint(g);
    if(child != null && child.isShowing())
    child.setVisible(true);
    This works on other applications but not on the Internet Explore (It always show the dialog).
    Anybody can give me a clue?
    Thanks!

    When you pop up a dialog, if you use the constructor:
    Dialog(Frame owner, boolean modal);
    and pass it an instance of the parent frame (and set "modal" to "true"), then it is my understanding that it should always appear in front of the parent - are you sure this is what you are doing?
    Double check by doing myDialog.getOwner() and make sure it's not null.

  • Is ABAP engine mandatory?

    Hi guys - Can you tell me where I can find information in regards to Java stack versus ABAP stack. I am looking to see if FS-CM and FS-CD modules can be installed only on Java system or ABAP engine is mandatory? if FS-CD and FS-CM availabile on either the ABAP stack, Java stack or require both? Both would have a sizing impact right?
    Regards
    K

    Hello,
    I guess ABAP engine is mandatory, see SAP Note:1304417.
    Regards,
    Yoganand.V

  • Log4J - reading properties file from /WEB-INF directory issue..

    I'm just learning to implement Log4J; the approach I am taking for my JSF application running under Tomcat 5.5x is to create an initialization servlet to initialize the logger, and then access the logger instance within my backing beans and application module services. I include log4j.jar file in /WEB-INF/lib and log4j.properties in /WEB-INF.
    First I wanted to see if this was a good approach, and secondly I'm having trouble accessing the log4j.properties file from the /WEB-INF directory (see below) - any suggestions on how to set up the path so that the properties file can be found (I receive a java.io.filenotfoundexception)?
    Where I'm looking for direction is how to define a single instance of the logger and then access that instance from my java classes versus re-creating the logger in each class.
    ----- web.xml --------
    <servlet>
    <servlet-name>LogServlet</servlet-name>
    <servlet-class>com.sidehire.view.util.LogServlet</servlet-class>
    <init-param>
    <param-name>setup</param-name>
    <param-value>/WEB-INF/log4j.properties</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet>
    ------ LogServlet class ------
    public void init()
    throws ServletException {
    String config = getInitParameter("setup");
    PropertyConfigurator.configure(config);
    Thanks
    Message was edited by:
    javaX

    Try to put the log4j.properties in your WEB-INF/classes/ directory.
    You could wrap one log4j instance in a static method in a utility class, but then you would probably lose other information depending on your logger configuration.
    If you create an instance in each class, which after all is just one line like this:
    static Logger logger = Logger.getLogger(ChangePasswrdAction.class.getName());
    then you are able to get time and method information.

  • Desktop Training

    We are a small consulting company, preparing to exploit what we hope will be a profitable a market niche, i.e. installing non-MS systems for small businesses.
    As part of the plan, we dropped MS-office and have been using Open office for about 6 mo now. The intent was to give the product a throrough workout, hopefully becoming experts in the process. Our evaluation of the experiment is as follows:
    Open office is OK but not great. For 90% of the documents we produce (reports, letters, and spreadsheets), it is perfectly adequate.
    Exchange of documents with Clients using MS Office is not problematic. Most reports are acceptable in PDF format, and simple spreadsheets convert well between the two office platforms. RTF has been found to be an acceptable (but not ideal) means of document transfer into Word for clients that require it.
    The major problem with successfully introducing Open Office has been lack of classroom training in use of the Tools.
    Actually, lack of training was an incentive for us to explore the issue. We hoped that we would be able to develop the expertise in house, and then give classes for profit, assuming that OpenOffice would have sufficient growth to make a good business case.
    Unfourtunately, we are still not able to exploit some features of the product ourselves, and do not find the documentation to be helpful in this regard. We too need some training. We are definitely not ready to start promoting Open Office to customers, and face the decision of continuing to use and promote Open Office (and the Java Desktop), versus reverting to MS Office.
    Our local Sun Office say they have no interest in Open Office, and after (unsuccessfully) browsing OpenOffice and this site for information on OpenOffice training/certification, I'm posting here to see if I have missed some offering in that domain
    Bill Winspur
    Wynnon Systems inc.

    You'll find web-based and classroom training on StarOffice here:
    http://training.sun.com/US/catalog/staroffice.html
    We also have training specific to the Sun Java Desktop:
    http://training.sun.com/US/catalog/courses/WOD-1000-90.html
    I hope this helps you meet your client's needs.

  • Plz help to solve this error in out.println statement

    Hi All,
    I am pretty new to weblogic8.1.I am Getting a error if i try to concatenate a object to the string in out.println
    statement.
    For your kind reference progam and error pattern is enclosed.
    public class Test extends HttpServlet
    PrintWriter out;
    public void doGet(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException
    out=res.getWriter();
    String aaa="Google";
    out.println("Hai"+aaa);
    ERROR IS:
    Error 500--Internal Server Error
    java.lang.NoClassDefFoundError: java/lang/StringBuilder
         at Test.doGet(Test.java:15)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
         at
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    If i use the statement like;
    out.println("Hai");
    out.println(aaa); ...It works fine
    Plz, help me out there.Thanks All.
    Prith

    My guess is this is a classpath issue. Read weblogic's documentation on how to install the software thoroghly, then re-install it. Double check that JAVA_HOME is set properly, and that you are using a fairly recent Sun Java VM, versus an old MS Java VM...

  • Adobe form - Dynamic resizing and UI elements access with relative path

    In the form, there are 190+ fields, grouped nad divided into different sections. We have section(subform) and field(UI Element) configurations in which we need to make Form ui elements invisible based on section/Fields.
    eg. < Code Snippet>
    if(SectionsList<i> == <SectionName1>)
              Page1.Section1.Field1.presence     =  "hidden";
                    Page1.Section1.Field2.p1esence     =  "hidden";
              <.. rest of fields>
    if(SectionsList<i> == <SectionName2>)
              Page2.Section2.Field1.presence     =  "hidden";
                    Page2.Section2.Field2.p1esence     =  "hidden";
              <.. rest of fields>
    Here we are using absolute path for the the ui elements which includes page numbers.
    The requirement is whenever we make a section or a field invisible the form size should get resized.
    e.g.let us say we suppress 2 sections occupying 3 pages of total 8 pages of the form, then the rendered form should have only 5 pages
    There are two issues here:
    1) When the UI elements of section are hidden, the section is not getting shrinked or resized
    2) Let us say above issue gets resolved and section gets shrinked; how can we locate the UI element using script? Currently we have coded java script for hiding UI elements by giving absolute path of UI element i.e. for example   Page1.Section1.Field1

    Hi Ganga,
    Yes at the time of design itself I will have the fields for one entity in a subforms flowed.
    and all these subforms into a large subform flowed. if there are some special fields they will be into a different subform.
    with is you will have a freedom of manuplating any subsection and since all the subforms are flowed it will automatically wrap up.
    In your case I dont find a reason to have a every single filed in one subform and is flowed unless your form is something like a single column / pillar like Qutub minar.
    If you can send me your xdp file, i can fix the design issue and can check whats resetting your form data.
    Cheers,
    Sai

  • Hide,lock,disallow autorun

    can anybody help me to develop java code for hiding,locking and disallow autorunning of drives? in both windows and linux it have to work.....

    You'll want to repost in the JNI forum--you're going to do some C/C++ coding, standard Java will not disable OS/Harware features.

Maybe you are looking for

  • Are these suggestions speficic to the Windows version of Firefox? Because on my Mac version (31.0) there is no "options" in the Tool menu

    Are these suggestions speficic to the Windows version of Firefox? Because on my Mac version (31.0) there is no "options" in the Tool menu. I'm trying to figure out why Firefox has no spellcheck. I suspect it needs dictionaries installed, but it's a b

  • New Session getting created(!)

              Hi All,           I am facing a wierd behavior. I have an application with a           login page(jsp). User submits his authentication details,           is authenticated in a servlet, and some of his information is           put in the se

  • Double Lookup in Numbers 3

    Hi this one has had me stumped for a while so I hope there's the expertise out there! I have two tables in different sheets; Lesson Sheet::Lesson Log Table and Pupil Summary Sheet::Pupil Progress Table. I need to populate the summary sheet using the

  • How to use "discontinuation data" in BOM item ?

    Hi everyone! I would like to use "discontinuation data" in BOM item , not in MRP4 view, how to set? thanks! Dandan

  • Changing .PNG Images

    I just got my MacBook yesterday and I have been trying to change my application icons but have run into a problem: all .PNG images have the same default image (the one with the piece of paper behind a photo that simply says "PNG") Every time I click