(Swing) Reading fields from other forms - Best practice

Hi All,
I have been learning Java and Swing through NetBeans (quite a cool way to do it). I would like some 'best-practice' advice please. Google and search on this forum are normally my friends, can't find anything relevant for this though. I have created an application that seems to be functional, all my navigation is through tabs.
To make my app portable I have created a ?Settings? part. To save having another tab, I have basically copied the way NetBeans deals with opening the ?About Box? in its example, and have set-up fields in here. This essentially opens a JDialog with fields through an option in the menu.
I figure the best way to store the data is in a simple text file, and have the application read the values on start-up? Then when somebody changes the fields and saves it just overwrites the text file with the new values. I am not sure how to best read these in though, I can?t find a way of reading direct from the JDialog (i.e. var.getText()) which makes sense as the JDialog will be closed.
Will my best practice simply be writing a class which reads the file, then whenever I need a value just calling the class?
Thanks a lot

You should not be using preference files unless you really know what you are doing. This is one area of the very few areas of Java programming that can have lasting nasty negative affects on a computer that runs the code if done wrong.
If you want the user to save preferences it is better to just use xml. The advantage of preference files is they can be used by multiple programs and are permanent even after the program is done running/deleted/writen-over/forgotten. The disadvantages of preference files is they can be used by multiple programs, are permanent even after the program is done running/deleted/writen-over/forgotten, can cause damage to your OS, may be seen as harmfull by add blockers and/or anti-virus software, may lead to conflicts with other software that uses similar naming schemes, and are pretty much unportable.
You are going to be much better off in the long run learning XML and just saving them there, an added benefit of XML is if you screw something up and it causes your program to no longer run you can easily edit the xml by hand.
JSG

Similar Messages

  • Protect Form Fields from "Clear Form"

    I've created PDF Form with various fields, and created button to make readonly for all the Field data. This PDF Form will be used by 3 persons in different section. How to protect all filled text fields from "Clear Form" function in Form Tool.
    Once the Form fields are filled by 1 person, the other person can not use the "Clear Form" function to clear all filled fields. Please guide to to protect filled text,checklist fields from "Clear Form".

    If one flattens the form fields then they become context and are no longer form fields. It is possible to selectively flatten PDF content like annotations, form fields, page ranges, and by the "print/no print" property for Acrobat versions 6 or above.
    The flattenPages is not available to Reader.
    PDFScripting.com has a tool bar button that can perform selective flattening.

  • What are Microsoft- or other's-best practice or recommendation of Disk usage, CPU usage, memory usage monitoring to prevent system trouble ?

    We use win2003,win2008,win2012 servers.
    I heard somewhere that Microsoft recommendation threshold of disk usage monitoring is ( free disk space >= 15- 20 %) , if I remember correctly, but how about CPU usage and memory usage monitoring ? 
    What are  Microsoft- or other's-best practice or recommendation of Disk usage, CPU usage, memory usage monitoring to prevent system trouble and improve availability ?

    Hi,
    You can refer the following Performance Tuning Guidelines,
    Performance Tuning Guidelines for Windows Server 2003
    http://download.microsoft.com/download/2/8/0/2800a518-7ac6-4aac-bd85-74d2c52e1ec6/tuning.doc
    Performance Tuning Guidelines for Windows Server 2008 R2
    http://blogs.technet.com/b/josebda/archive/2010/08/27/performance-tuning-guidelines-for-windows-server-2008-r2.aspx
    WINDOWS SERVER 2012 - PERFORMANCE TUNING GUIDELINES
    http://blogs.technet.com/b/itprocol/archive/2012/11/27/windows-server-2012-performance-tuning-guidelines.aspx
    Hope this helps.
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Arranging fields in a table-like form: best-Practice-Solution wanted

    Hello Experts,
    I´m wondering if there exists a 'best practice' considering how to arrange fields in a table-like form.
    I know about cross-tables, but that´s not what we need. Most of the requirements that I have come to known are just that certain fields should be put in a certain order in a table-like outfit.
    We have tried to do this using the drawing functions (e.g. putting a square around the fields and certain border styles), but it often happens that the lines overlap or there are breaks between the lines, so that you have to do a lot of manual configuration with the 'table'.
    Since this is a requirement I´ve come upon with many reports, I can´t believe that this is supposed to be the best solution for this.
    I don´t understand why there isn´t a table-like element in Crystal Reports to use for this. E.g. put a table with x rows and y columns in the header or group head section section and then just put the fields in it.
    Many thanks in advance for your help !

    Hi Frank,
    You can use build in templates available in Template expert.
    Click on Report menu-> Template Expert.
    Select the desired template. ( Table grid template would suite best here) and click OK.
    There is no facility of inserting a table directly as you said. You will have to do it manually by using lines and boxes.
    Hope this is helpful.
    Regards

  • Need to get the values from "Signed" field from PDF form.

    Hi,
    This is Dinesh. I am PHP Developer. My issue is "I am not able to get the value of "signed" field from the PDF form when the form has been submitted.". I want to get the Digital Signature value of that field and i need to store it in the DB.
    Please help me here Or Please forward this issue to any of the PHP developer who solved this issue and let me know.
    Thanks & Regards
    Dinesh

    Hi Vikas,
    you can use this badi MRM_WT_SPLIT_UPDATE, the method will be WHTAX_SPLIT_UPDATE
    in this badi please see the importing and exporting parameters, you will get the  values of withholding tax code  as TE_RBWS in export parameters.
    Please search in google or SCN you will get how to use it.

  • Import files into bridge from a CMS - best practice

    Hi All,
    i am trying to come up with the simplest solution for the following:
    we have a CMS in which our content is managed and edited.
    the content editor might like to edit video files that reside in our asset management system.
    our editing tool is Adobe Premiere.
    My thought was to transfer the video file along with its metadata and edit instructions to an FTP server from our asset repository and then transfer these files into the video editing local environment using bridge. after editing the file - it should be transferred back into the asset repository via FTP server or such.
    it seems the way to this would be to extend the bridge functionality using the java script SDK, but i would love to know if there is a best practice solution before we start detailed design and development.
    your help is highly appreciated and thanks in advance,
    Deena

    Not sure what advice you have been given and how you have interpreted it.
    You are of course referring to im6 here since you can't drag projects from im08 to iDVD.
    I don't make many DVD's anymore and may well be wrong here but I'm not aware that dragging an im6 project to iDVD is any different than using share/iDVD and I'm wondering if the advice relates to exporting from im6 and then importing the exported movie into iDVD which is indeed a different workflow.

  • OIM Database Connector - ID PK from DB Sequence Best Practice?

    Figured I'd ask around before I hacked something together for something that is a very common scenario. When provisioning my PK (ID) is not set and is set via a Oracle Sequence. I'm currently using the Database Application Tables GTC connector. A couple approaches, based on my limited OIM knowledge:
    1. OnInsert DB trigger to handle. Requires nothing from OIM for this, but I really feel like this is way too invasive and doesn't support the "passive" nature of Identity Management.
    2. Deviate from the GTC and get the SEQUENCE from a custom adapter task.
    3. Go have a beer.
    If there is some documentation or posts regarding this please let me know. I checked the best practices & connector docs and found nothing about this.

    I think you have a good grasp of the problem. Option 3 is of course superior to the others :)
    If you start using pre-pops on GTC generated forms you can't regenerate the GTC or you risk losing the pre pop connectors.
    There has been some discussions around what Oracle supports when it comes to GTC but it seems like you now can add prepop and entity adapters and still stay in support.
    Best regards
    /M

  • Unable to process more than 100 fields from a form

    I am having trouble with posting data from APEX to the database when a form has a large number of columns. I get a 404 “The webpage cannot be found” error when submitting.
    The Apache logs showed the following error when a form containing 109 fields is processed (update or insert):
    +*[Fri Jan 29 10:45:39 2010] [error] [client ##.#.##.#] [ecid: 79599930492,1] mod_plsql: /pls/apex_dev/wwv_flow.accept HTTP-404*+
    wwv_flow.accept: SIGNATURE (parameter names) MISMATCH+
    VARIABLES IN FORM NOT IN PROCEDURE: P_T101,P_T102,P_T103,P_T104,P_T105,P_T106,P_T107,P_T108,P_T109+
    NON-DEFAULT VARIABLES IN PROCEDURE NOT IN FORM:+
    This seems to suggest that the large number of columns (109) or the string length of the post associated with the larger forms may be the problem.
    Since the sting length of a post has a limit of 2MB then this can not be the problem source.
    I found from APACHE server documentation that there is "LimitRequestFields" Directive with a Default: LimitRequestFields 100
    I found further support for this theory when I tested forms with 99,100,101 fields respectively.
    The error (HTTP-404) only occurs when the number of fields on the form exceeded 100.
    I then had our DBA change the default setting in the httpd.conf file to 128 fields which I read somewhere was an APEX limit (not sure of this).
    This did not fix the problem and the same HTTP-404 and Apache log result occurs.
    Any ideas on a solution would be greatly appreciated.

    Varad,
    Thank you for clarifying. I did convince myself that I had found the solution in the Apache config. idea but all I had found was a red herring. Also, I did search the forum before asking my question but obviously not well enough. Since your reply have found a number of references to the 100 limit.
    I think I may have a workaround, possibly involving a wizard insert/update approach. Will need to test.
    Cheers,
    Meagain

  • Where is Forms Best Practices guide?

    I'm looking for
    Best practices when Developing Applications with Forms 10gR2
    which is listed on the documentation tab, here:
    http://www.oracle.com/technetwork/developer-tools/forms/documentation/techlisting10gr2-087608.html
    But the link:
    http://www.oracle.com/technetwork/developer-tools/forms/documentation/ssLINK/164049
    gets a 404 error.
    Looking through the forums threads and googling, I find references to its being located here:
    http://www.oracle.com/technology/products/forms/pdf/BESTPRACTICES10GR2.pdf
    but that redirects back to the home page.
    Anyone know where I can find it?
    Thanks,
    Rebeccah

    I believe the doc for which you are search is here:
    http://www.oracle.com/technetwork/developer-tools/developer-suite/bestpractices10gr2-164049-fi.pdf
    I have requested that the Forms OTN page be corrected to point to this url. Thank you for bringing it to our attention.

  • One-time import from external database - best practices/guidance

    Hi everyone,
    I was wondering if there was any sort of best practice or guideline on importing content into CQ5 from an external data source.  For example, I'm working on a site that will have a one-time import of existing content.  This content lives in an external database, in a custom schema from a home-grown CMS.  This importer will be run once - it'll connect to the external database, query for existing pages, and create new nodes in CQ5 - and it won't be needed again.
    I've been reading up a bit about connecting external databases to CQ (specifically this:http://dev.day.com/content/kb/home/cq5/Development/HowToConfigureSlingDatasource.html), as well as the Feed Importer and Site Importer tools in CQ, but none of it really seems to apply to what I'm doing.  I was wondering if there exists any sort of guidelines for this kind of process.  It seems like something like this would be fairly common, and a requirement in any basic site setup.  For example:
    Would I write this as a standalone application that gets executed from the command-line?  If so, how do I integrate that app with all of the OSGi services on the server?  Or,
    Do I write it as an OSGi module, or a servlet?  If so, how would you kick off the process? Do I create a jsp that posts to a servlet?
    Any docs or writeups that anyone has would be really helpful.
    Thanks,
    Matt

    Matt,
    the vault file format is just an xml representation of what's in the
    repository and the same as the package format. In fact, if you work on
    your projects with eclipse and maven instead of crxdelite to do your
    work, you will become quite used to that format throughout your project.
    Ruben

  • Reading fields from a text file

    Hi, I'm fairly new to this so bear with me.
    This is for an assignment - the idea is to cretae an online system for booking seats at a cinema - haven't got past the login stage yet?
    I've got an applet that needs to read in a field from a text file.
    I'm using the StringTokenizer function.
    I've put a test in to check that the applet can find the file, which seems to be ok.
    However, it's not reading from the file.
    Te file is a simple text file - fields are seperated by a comma and a space.
    Any ideas?
    Please help as this is quite urgent.
    Prototype Code is below
    public class cinema extends Applet implements ActionListener, ItemListener{
    private List ActionList;
    private int listIndex;
    TextArea t = new TextArea(5, 30);
    private Button gobutton, writebutton, login, logout;
    private PrintWriter suggestfile;
    TextField Userid, password, enterField;
    private int count, checkuser;
    private BufferedReader firstn;
    File myFile = new File("e:\\Ian\\Unistuff\\2nd Year\\se2\\cinema2\\src\\cinema2\\member.txt");
    //Construct the applet
    public cinema() {
    enterField = new TextField("Please enter user ID and Password");
    enterField.setEditable(false);
    add(enterField);
    Userid = new TextField(3);
    add(Userid);
    password = new TextField(10);
    password.setEchoChar('*');
    add(password);
    //Initialize the applet
    public void init() {
    BorderLayout borderLayout1 = new BorderLayout();
    //some code ommitted
    t.setEditable(false);
    add(t);
    gobutton = new Button("Go!");
    add(gobutton);
    gobutton.addActionListener(this);
    public void actionPerformed(ActionEvent event) {
    if (event.getSource() == gobutton) {
    try {
    firstn = new BufferedReader( new FileReader(myFile));
    catch (IOException e) {
    t.setText("Member database missing - please contact Chairperson");
    return;
    try {
    String line1;
    boolean found = false;
    while (( ( line1 = firstn.readLine() ) != null) && (! found))
    {StringTokenizer token1 = new StringTokenizer (line1, " ,");
                              String user = token1.nextToken();
                                 if (Userid.getText().equals(user))
                                   { found = true;
                                     t.setText("Hello");
    firstn.close();
    catch (IOException e) {
    System.err.println("Error Reading File " + myFile + ": " + e.toString());
    Here's the text file:
    Ian, Dodson, 001, rubbish
    Joe, Bloggs, 002, medway
    Bill, Smith, 003, unique
    Guest, , Guest,
    To test that it is working, it should just put a message in the Text Area, but nothing happens when you press the "go" button.

    1. Your applet will not work, because it is trying to
    read file from local disk.
    2. This task can be solved by simple CGI script
    (which is much more common and universal thing than
    java), so you do not need to use java if you want to
    send 3 lines to a server.
    3. See examples and read some books.1. Stated the obvious.
    2. This is a java forum, not Perl.
    3. Pathetic and patronizing.
    Very helpful.

  • Some fields from InfoPath form not showing up in Sharepoint

    I created an InfoPath form containing a checklist that sends data to an InfoPath document library in Sharepoint 2010.
    Most of the fields that I have linked to the sharepoint transfer their data just fine, but 2 of the fields come out blank in SharePoint.
    I have attempted the following fixes to no avail:
    Created site column and linked to it
    Deleted column and had Infopath create a column in the library
    The fields are not identically formatted either.  Both are single item drop down lists, one is populated by an external data source (sharepoint list) and the other has manual list values.  Both fields have other fields in the form that are formatted
    identically and work just fine.
    help!

    Do the choice items match up in the form to the options available in the list?

  • How to keep the input field from PDF Form to RTF

    Hi,
    I'm looking to keep the input fields from my pdf form document to Rtf so I can use them in my Rtf document.
    Regards,
    Alan

    Good day Alan,
    I'm afraid that's not possible as form fields in a PDF file have no equivalent either in a Word format (.docx/.doc) or within the Rich Text Format (.rtf).  That data is simply stripped during the conversion as there's no equivalent available.
    Kind regards,
    David
    Acrobat Community Manager
    Adobe Systems

  • Import data from excel file - best practice in the CQ?

    Hi,
    I have question related to importing data from excel file and creates from those data a table in the CQ page. Is inside CQ some OOTB component which provides this kind of functionalities? Maybe somebody implement this kind of functionality or there is best practice to do this kind of functionalities?
    Thanks in advance for any answer,
    Regards
    kasq

    You can check a working example package [1] (use your Adobe ID to log in)
    After installing it, go to [2] for immediate example.
    Unfortunately it only supports the old OLE-2 Excel format (.xls and not .xlsx)
    [1] - http://dev.day.com/content/packageshare/packages/public/day/cq540/demo/xlstable.html
    [2] - http://localhost:4502/cf#/content/geometrixx/en/company/news/pressreleases/my_personal_bes ts.html

  • Update fields from Adobe Form to Table

    Hello,
    I want to integrate Adobe Form into Webdynpro ABAP Application in which I want to have 2 fields which need to be updated to a DB Table.
    For this first I created an Interface in Transaction SFP , added 2 import parameters of type <Table Type>-<FieldName>. Then I created a Webdynpro Component created a new I Interactive Form UI Element and binded the Context of the Form to the Interface.
    Then I added 2 fields to the form from Data View . Everything is fine but when I run the Webdynpro Application the fields are not available for Input.i.e. They are in the ReadOnly Mode.
    The 'enabled' property of the Interactive Form is checked.
    Please help.
    Any help would be highly appreciated.
    Thanks.
    Edited by: SAPEPDeveloper on Feb 7, 2011 11:45 PM

    Hi,
    The process explained is ok, but I can explain you a better way.
    1) Create the webDynpro Component first.
    2) Create the context nodes as per the requirement.
    3) From the 'integration' panel drag and drop the Interactive form UI element into the view.
    4) Bind dataSource to root context node.
    5) Check enabled property true.
    6) Give a template source name (ZName).
    7) On double clicking the template source, system will prompt you to enter the interface name. Map context node to the interface.
    8) Interface gets created automatically and the lifecycle designer gets opened.
    9) Goto the properties tab and give layout type as 'ZCI Layout'
    10) Drag and drop required fields from the data view to the layout designer.
    11) Insert webdynpro script from the Utilities
    12) Edit -> Form Properties -> Defaults -> XDP Preview Format should be dynamic
    13) Drag and drop 'Submit Button' from Library palette -> Webdynpro native controls
    On clicking the submit button at runtime you will get the control in the webdynpro submit event.
    Above all these you have to check with your basis team, that the 'usage credentials' have been applied while configuring the ADS. Go to SE38 and run the program 'FP_TEST_IA_01' and check whether it is giving an error message or not.
    Hope this Helps.
    Thanks & Regards,
    Sanoosh

Maybe you are looking for