Basic threading question

I've tried to understand threading from ten different tutorials, but it makes my head spin because all the tutorials include so much extra stuff that I don't know what's important.
I've got a piece of code here with a gui, which contains a progress bar. I'd like the progress bar to update in a timely fashion, but not take up much of the main thread's recources.
I've cut the code down to it's barest minimum. I'd really appreciate it if someone could tell me how to edit this code so that it implements threading. Thanks so very much.
public class MeGA {
     private static Interface gui;
     private static EvolutionEngine engine;
     public static void main(String[] args) {
          engine = new EvolutionEngine();
          gui = new Interface(engine);
          engine.setGUI(gui);
public class Interface {
     // A bunch of methods that set up the gui
     // And then my progress bar method
     public void updateProgressBar(int value){
          bar.setValue(value);
public class EvolutionEngine {
     public void start() {
          For (int i=0; i<x; i++)
               // Do a bunch of stuff
               // then update progress bar
               gui.updateProgressBar(i);
}

Thanks for the reply.
The run() method works great now, and threads well with the progress bar.
However, I can't seem to start it up again after the run() method has completed (i.e. pressing "run" on my gui, which calls engine.start() does nothing the second time around).
The method run() has definately quit, and, as an experiment, I threw in a stop() command for good measure. Nothing.
When I switch the threaded method for my original method, everything works fine (except it doesn't thread), so it's obviously something to do with the thread.
Any suggestions as to why I don't seem to be able to call start() twice, when the first one should certainly have quit?
Thanks!

Similar Messages

  • Adding Date/Time Field + X Number of Days - Basic Calculation Question

    I am assuming this is a basic calculation question. New to Adobe LiveCycle Forms.
    I have a simple form containing a table. The table appears as such:
    Text
    Formatted as Date/Time Fields
    Header 3
    Monday
    user wil choose the beginning date (Date/Time) this is DateTimeField1
    Tuesday
    this should calculate DateTimeField1 + 1
    Wednesday
    this should calculate DateTimeField1 + 2
    Thursday
    this should calculate DateTimeField1 + 3
    Friday
    this should calculate DateTimeField1 + 4
    Saturday
    this should calculate DateTimeField1 + 5
    Sunday
    this should calculate DateTimeField1 + 6
    Calculations are performed after the date is chosen for Monday. My mind tells me the simple calculation of DateTimeField1 + 1 is not going to work (and in fact doesn't!) as it needs to change Monday to a number first. I saw on another thread the following:
    Num2Date(Date2Num(Date(DateTimeField1), "DD.MM.YYYY")+7, "DD.MM.YYYY")
    Thought this was going to get me close. No cigars though!
    Any quick help is greatly appreciated. And since I am new to this, details about what needs to be changed would be great too!
    Thanks

    Here an addition for you date field.
    This FormCalc script in the exit:Event will check it the selected date is on a monday.
    If not it will go the days back until the last monday.
    var Selection = Date2Num($.formattedValue, DateFmt(2))
    var WeekDay = Num2Date(Selection, "E")
    var NewDate
    if (WeekDay eq 1) then
              NewDate = Selection - 6
    elseif (WeekDay eq 3) then
              NewDate = Selection - 1
    elseif (WeekDay eq 4) then
              NewDate = Selection - 2
    elseif (WeekDay eq 5) then
              NewDate = Selection - 3
    elseif (WeekDay eq 6) then
              NewDate = Selection - 4
    elseif (WeekDay eq 7) then
              NewDate = Selection - 5
    else
              NewDate = Selection
    endif
    $ = Num2Date(NewDate, "EEE DD.MM.YYYY")
    Hope this helps, too.

  • Basic iPhoto questions:

    I have some Basic iPhoto questions before I start using the program:
    - does iPhoto apply any compression or change images in any way when they
    are imported?
    - after images are imported, can the original source folder of images be deleted off of the mac?
    - can Quicktime files exported from iPhoto be viewed on a Windows computer?
    - can iPhoto handle large resolution images that might be as large as 8-15mb each? does it display them quick? are there any known file size issues?
    Thanks!!!!

    kat.
    Is there a way to use iPhoto on a network so other users can read and possibly write to an iPhoto library on a networked mac?
    iPhoto is a consumer level photo organiser, not a server. It's possible to share photos but libraries are very difficult and fraught with the danger of database corruption. Some have reported success.
    Is it possible to password protect or secure certain images in the library so they can not be seen by anyone?
    No. The best I can suggest there is to create a second library and store it in a secure area like a protected dmg. But remember, you can only have one library open at a time.
    After photos are deleted from iPhoto, are there any remaining traces or cached files anywhere other than the trash
    If you delete photos from iPhoto and empty the iPhoto trash then the pics are removed from the Finder as well. They remain as findable as any other deleted file from that point, which is, very, if the searcher in knowledgeable.
    Regards
    TD

  • Object class deployment - Basic form question

    OK, I subclass calendar object from Oracle provided standard
    object class. What do I need to deploy to use this form now
    apart from calendar.pll and my fmx. What about the object class
    from which I sub-class. Do I need to compile and deploy that
    also? How will form resolve this on run time the parent object
    class as I really did not copy, just sub class and we do not
    deploy original class? Basic form question. Thanks.

    You can set the "help" property on the field (which gives you the little "information" icon link beside the field).
    You could also try adding another field of another class above or below:
    <Display class='InlineAlert'/>
    <Display class='ErrorMessage'/>
    <Display class='HtmlPage'/>
    ..etc
    -Rob

  • Thread questions

    Hi,
    Here are my Thread questions:
    Q.1 I don't understand interrupt() and internal flag and when should I use it?
    Q.2 What does "No thread can make another thread yield" mean?
    Q.3 Given:
    public class MyRunnable implements Runnable
         public void run()
              //some code here
    What is the proper way to create and start this thread?
    Ans: new Thread(new MyRunnable()).start();
    Why does it need to add new Thread as prefix?
    Q.4 Given:
    public class MyT extends Thread
         public void run()
              try
                   for(int i=1; i<5; i++)
                        System.out.print(i + " ");
                        if(i>2)
                        interrupt();
                        sleep(1000);
                        if(interrupted())
                        break;
              catch(InterruptedException e)
                   System.out.print("Caught");
    Assume another object creates an instance of this Thread and starts it. Why does the outcome is:
    1 2 3 caught
    Thanks
    gogo

    You can find a lot of answers to your questions in the java tutorial.
    http://java.sun.com/tutorial

  • Basic Exporting Question

    My main question is a very basic exporting question, but here is a super-condensed explanation of my big-picture goal for context:
    Large (~450 MB) aiff on CD --> trim w/ Quicktime --> small (~16 MB) MP3 in iTunes
    I would like to take an audio file (aiff) that is approximately 450 MB and export it from Quicktime and in doing so, reduce the file size and convert it to MP3. When I simply try to export it, it doesn't ask me about what size I want, nor does it give the option of MP3 formatting.
    I have figured out how to reach my goal, but it's a mess. After I make my trims in QT, I have to:
    1. select "share" instead of "export".
    2. It asks me what size I want and I select small.
    3. The file is then exported as a Quicktime movie into Mail and the size is reduced from 450 MB to about 20 MB.
    4. I then have to "right-click" on the attachment in the email that is created,
    5. save the attachment,
    6. discard the email,
    7. import the file into iTunes, and
    8. create an MP3 in iTunes to finally arrive at my goal.
    This seems like a ridiculously convoluted process to change a large aiff to a small MP3 and put it in iTunes. Any suggestions?

    Thanks. I guess the basic answer to my question is that it can't be done in one or two fell swoops. The problem is that it starts on a burned disc, and I need to make edits to it before it ends up in iTunes (to be eventually used in iWeb). I was hoping to avoid juggling back and forth between iTunes and QT. I either would have to send it back to QT to do the edits after -->iTunes-->mp3, or import the large file from the CD to QT, make the edits, save changes, import large file to iTunes, convert to mp3.

  • Basic interview questions in abap ddic

    can any one pls give me the link for basic ddic interview questions

    Check these threads.
    need real time interview questions on data dictionary
    The specified item was not found.
    data dictionanry

  • Premiere Elements 7 Basic Editing Question for DV

    Hello all,
    I have PE7, a Q6600 quad-core, and Windows 7 64bit.
    I have captured about 6 hours of Standard Definition 16:9 DV footage from my church's grand opening ceremony.  Video was captured from an old Pana PV-GS320.
    The church wants a dynamic video to be produced from the captured footage (60 minutes at the most in length).  I plan on doing many different effects including semi-transparent video layering, picture in picture, inserting photographs, and inputing audio clips from the ceremony.  The final product will be a standard definition DVD disc.
    I've done some research regarding how DV is interlaced and output for  DVD should be interlaced (unless I'm wrong in that conclusion, let me  know).  I also know that doing heavy editing with interlaced footage  (slowing/speeding footage, zooming in and out, rotating, multiple  layering, etc) may create flickering and "mice teeth" in the video.  I've also searched through these forums and keep on running into HD  questions/solutions...  I guess I'm asking an old question that was probably  answered long ago when DV tape ruled the world.
    QUESTION 1:
    So, if I may ask, in order to get the best results, should I prepare my raw footage in PE7 before editing it by (1) by deinterlacing it? (2) exporting it as progressive? (3) both? (4) leave it alone and begin editing away? or (5) am I missing another option?
    QUESTION 2:
    Also, what resolution would be best to import the photos into the project?
    I know the best way to work with any video is to make as little changes as possible to it, but this is unavoidable in my case.  No one wants to sit through 6 hours of video...
    Thankyou very much for reading my questions and I really hope you have some time to answer it!  Thanks for any information!  I really appreciate it!
    -141rockwell

    Relax, rockwell. You're making it all unnecessarily complicated.
    If you've captured your video as DV-AVIs over a FireWire connection, you won't get "mice teeth" in your final product. The program is designed to work with interlaced video and create interlaced DVDs. The results should look virtually as good as the original footage! You can't damage video with "excess editing."
    Just trust the program to take care of the technical issues. You can concentrate on the editing.
    As for any photos you want to add, you'll get the best results if they're no larger than 1000x750 pixels in size, per the FAQs to the right of the forum.
    http://forums.adobe.com/thread/431851?tstart=30
    Meantime, if you're looking for some basic help with the program, be sure to check out my free 8-part Basic Training tutorials at Premiere Elements support site Muvipix.com.
    http://forums.adobe.com/thread/537685?tstart=0

  • Basic PBE questions and clarifications

    I have some basic questions about PBE and java.
    My first question is how do I determine the size of the derived key that will actually be used? Do we have any control over that? I guess that the password strength is probably more important than size of derived key in PBE(?), but I'd still like to understand what's happening.
    Following on that - do the characteristics of the initial PBE password have any bearing on the strength of the encryption (ie the size of the derived key), when using PBE?
    Finally with standard install of Sun 1.5 JRE, the security jurisdication policy files prohibit the use of PBEWithMD5AndTripleDES. However the Sun JDK from 1.5 supports PBEWithSHA1AndDESede and this appears to work with the standard (strong), policy files.
    This being the case (and please correct if this is wrong), what is the difference between TripleDES and DESede - I thought they were analogous. Why is one PBE scheme available with standard (strong), 1.5 policy files and the other prohibited?

    peckham wrote:
    Thanks for response - cleared some things up. My focus now is on why PBEWithMD5AndTripleDES fails with 1.5 strong policy files whereas PBEWithSHA1AndDESede appears to work.
    You said:
    ... The only difference I can imagine is that TripleDES could use the two key version which has only 2*56 bits for a key but this would still require the 'unlimited strength files.To clarify do you mean to say DESede could use the two key 2*56 version? I ask because DESede is the one that seems to work so I would expect that to be the one using the smaller key size.
    Could you also explain why you would expect 2*56 version to require unlimited strength files - I thought 128 bits was the limit for DESede keys with Strong Jurisdiction Policy files.I thought the threshold was lower than 128 bits but I can't be certain.
    >
    >>
    Why is one PBE scheme available with standard (strong), 1.5 policy files and the other prohibited?As I said, they are they should be the same.
    Note - there was a bug in earlier JRE whereby if one used the key.getAlgorithm() method to use to create a Cipher i.e.
    Cipher cipher = Cipher.getInstance(key.getAlgorithm());one always got PBEWithMD5AndDES. This, of course, does not require the 'unlimited strength' files.
    I found [this posting |http://forums.sun.com/thread.jspa?threadID=5129170&start=0&tstart=0] that you (sabre150), contributed to back in 2007. I've modified the JDKIssueTestCase to use:
    Cipher cipher = Cipher.getInstance(algorithm);Running this under 1.5 with 'strong' policy files PBEWithMD5AndTripleDES fails but PBEWithSHA1AndDESede succeeds. Here is the output:
    JVM Name: "Java HotSpot(TM) Client VM"  Version: "1.5.0_10-b03"  Vendor: "Sun Microsystems Inc."
    OS Name: "Windows XP"  Version: "5.1"  Architecture: "x86"
    Sun JCE: [SunJCE version 1.5]  Info: [SunJCE Provider (implements RSA, DES, Triple DES, AES, Blowfish, ARCFOUR, RC2, PBE, Diffie-Hellman, HMAC)]
    Algorithm: [PBEWITHMD5ANDTRIPLEDES]  Max key length: [128]
    Result Failed: [java.security.InvalidKeyException: Illegal key size]
    Algorithm: [PBEWITHSHA1ANDDESEDE]  Max key length: [128]
    Result Encrypted: [-70, -45, 57, 35, -29, 5, -113, -118, 102, 14, -119, -81, 125, 8, 56, -8]
    Algorithm: [PBEWITHMD5ANDDES]  Max key length: [128]
    Result Encrypted: [-56, -33, -40, -75, -41, 48, -39, 83, 122, 88, -70, 27, -69, 55, 85, -18]
    Algorithm: [PBEWITHSHA1ANDRC2_40]  Max key length: [128]
    Result Encrypted: [50, 66, -63, -84, -123, 13, -113, 77, 67, 80, -66, -70, 90, 23, -53, 13]
    Interesting.
    So I'd still like to know what is happening here especially in light of the bug highlighted in thread 5129170 - if I use PBEWithSHA1AndDESede without unlimited strength jurisdiction files what encryption strength am I actually getting? No real idea. Research is required.
    >
    I know that most people won't care about this but I work in a monolithic organisation where 1.4 is still the default JRE. There may be other unfortunates out there in similarly constrained environments so this might still be of some benefit.:-)

  • About threads question

    If only one thread write a basic type variable(like int,float),the other threads only read this variable,need use synchronize.
    thanks.

    If you're asking if you need to sync on a primitive type when that type is both read and written to (even by only one thread), the answer is it depends on the size of the type.
    If the type is 32-bit (4 bytes) or less (byte, short,int,float), the JVM spec garanties that the operation is atomic. (no need to sync)
    For 64-bit (8 bytes) data or more (double, long), the spec recommend that the JVM implementation treat the operation as atomic, but it is not required.
    If you need to sync, and you have only one thread writing to the data, and many threads reading it, consider using read-write locks, for efficiency. See Doug Lea's util.concurrent package .
    Try to make an effort in formulating your questions, that would help us help you...

  • Follow-up Basic XML Questions

    First, I apologize to the board in advance because I started a very similar topic already. I know this can be annoying but I think I'm worried that people will ignore my original post because there was already a reply to it. I added 2 follow up posts and nobody has responded. It could well be because they feel that my questions were already answered. After reading and re-reading the person who replied to my original question I did start to pick up many answers from his post. However, I guess I have some follow-up questions and felt compelled to start a new thread to get this "out there" again. I promise to try not to do this again and, once again, I apologize for starting multiple similar topics. Anyway, here goes my follow-up questions...
    I'm pretty new to XML but I've been reading an article on msdn about it and listed some code from the article at the bottom of this post.
    I have some questions about namespaces. From what I understand, a namespace is a unique identifier (it's a string). The thing that's bugging me though is this line...
    <x:transform version='1.0' xmlns:x='http://www.w3.org/1999/XSL/Transform'>
    Maybe I'm wrong, but my gut feeling is that this particular namespace has a special meaning (in other words, it goes beyond being just a unique identifier). Am I correct on this?
    From other stuff I've read I have another gut feeling that there are certain namespaces that somehow have schemas attached to them automatically. I've read that a schema can be "namespace aware". So, as a guess at the answer to my original question - are there certain namespaces that are something like "keywords" (similar to the concept of "keywords" in programming languages)? And is the "big deal" about these particular namespaces that they have schema definitions attached to them somehow? Any help would be GREATLY appreciated!
    EXAMPLE CODE FROM THE MSDN SITE:
    <x:transform version='1.0'
    xmlns:x='http://www.w3.org/1999/XSL/Transform'
    >
    <x:template match='/'>
    <hello_world/>
    </x:template>
    </x:transform>

    this particular namespace has a special meaning .... Am I correct on this?Yes, that namespace has a "meaning", but only to a program that implements the XSLT language. Likewise a "purchase order" namespace has a "meaning", but only to a program that is designed to read XML with that namespace and convert it to purchase orders in somebody's accounting system. (Just as the codes 'A', 'C', and 'D' could mean 'Add', 'Change', and 'Delete' to a program that maintains a database.) Similarly element names have a "meaning", but only to a program that is designed to understand that "meaning". A Java program has a "meaning" but a COBOL compiler doesn't understand that "meaning".
    From other stuff I've read I have another gut feeling that there are certain namespaces that somehow have schemas attached to them automatically.Not that I've ever heard of.

  • Plzzz write prog to this simple java threads question

    Write a program in C to create four processes. The original processes creates
    two children before it prints out "PARENT". The children processes print
    "CHILD1" and "CHILD2" respectively. The first child process creates a child
    process that prints out "GRANDCHILD".
    Note: The output must be guaranteed to print out in the following order each
    time it is executed:
    GRANDCHILD
    CHILD2
    CHILD1
    PARENT
    a. Write the program using C or C++ and forks to create the children processes.
    b. Write a second program using Java and Threads for the children processes.
    The output statements for CHILD1, CHILD2 and GRANDCHILD must come from print
    statements in the run method of the thread.

    Most people here will not do your homework for you. If you post a reasonable question that shows you've made some effort, and what the results of that effort were, and provides details about what parts you're having trouble with, then somebody will probably provide guidance so that [you can complete the work.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Few basic SRM questions .......

    I recently completed the SRM training from SAP and I have few basic questions and need help. Full points will be rewarded.
    These are my questions and it is based on SRM 5.0 Classic Scenario with R/3 backend
    1. Invoice  & confirmation transferred to R/3 via  ALE ? .  All other documents are transferred to R/3 via RFC?
    2. Based on the configuration, if the material is available in the backend then reservation will be created. Other wise PO will be created.  For text items, PR will be created.
         a. Who (purchaser) will process the PR in R/3 and how it is processed?.
         b. Who (purchaser?) will process the reservation in R/3 and how it is
             processed?. Assume no sourcing is setup in this case and No MRP run.
    3. How the vendor is linked to the Material or product category in SRM?. During the vendor replication from R/3, vendor and material/prod category link is automatically maintained?
    4. How the vendor is linked to a specific purchasing org/group? Is it based on the prod category assigned in the org structure for each purchasing org or purchasing group?
    5. How to do delta prod category replication?
    6. How to do Delta Material Replication?.
    7. Contracts and vendor list:-
        In our SAP training we created these from the browser. But in the actual
        implementation how do we create this?. Is it always from the browser?
    8. Direct Material and Plan driven Procurement.
       Can we use catalog items as direct material?. Just for example - > What
       about ‘Car Batteries’ that  is directly used in production and has the inventory
       also. But we are using electronic catalog for procuring this item. Is it possible to
       order this as direct material?
    9. How to replicate Plant. How to use DNL_PLNT?. Is BBP_LOCATIONS_GET_ALL will replicate all the PLANT's and its locations from the R/3 backend?
    10. In the HR system, which transaction we can view the org structure?

    Hi
    Answers to your questions ->
    1. http://help.sap.com/saphelp_srm50/helpdata/en/e9/d0fc3729b5db48e10000009b38f842/frameset.htm
    http://help.sap.com/saphelp_srm50/helpdata/en/74/ec7b3c91c1eb1ee10000000a114084/frameset.htm
    http://help.sap.com/saphelp_srm50/helpdata/en/55/d77c3c3fd53228e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_srm50/helpdata/en/77/e97b3c91c1eb1ee10000000a114084/frameset.htm
    2.  Provided the necessary role is given to the Purchaser (Buyer) in the System.
    a) Yes
    b) Yes
    3. http://help.sap.com/saphelp_srm50/helpdata/en/e5/f5e938b4ece075e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_srm50/helpdata/en/70/00c73a584611d6b21700508b5d5211/frameset.htm
    4. http://help.sap.com/saphelp_srm50/helpdata/en/2c/867d3ca2156c6ae10000000a114084/frameset.htm
    The vendor ORG has to be seperately created through trasaction PPOCV_BBP before replicating the Vendors from the R/3 System.
    http://help.sap.com/saphelp_srm50/helpdata/en/70/00c73a584611d6b21700508b5d5211/frameset.htm
    5. http://help.sap.com/saphelp_srm50/helpdata/en/42/d3b671ba67136fe10000000a1553f7/frameset.htm
    6.  http://help.sap.com/saphelp_srm50/helpdata/en/29/d586398dcfd74fe10000000a11402f/frameset.htm
    http://help.sap.com/saphelp_srm50/helpdata/en/05/9b8139437eac2ae10000000a11402f/frameset.htm
    http://help.sap.com/saphelp_srm50/helpdata/en/f5/b4bcdac7c40c4dba53e3695d18236c/frameset.htm
    7. Yes, from Browser it's quite easy and is quite user-friendly.
    8.
    http://help.sap.com/saphelp_srm50/helpdata/en/d3/4b9c3b122efc6ee10000000a114084/frameset.htm
    http://help.sap.com/saphelp_srm50/helpdata/en/18/db183d30805c59e10000000a114084/frameset.htm
    9.
    You can use the following three routines to download locations from the backend system and store them as business partners in SAP Enterprise Buyer.
    BBP_LOCATIONS_GET_ALL
    To get all the location numbers from each backend system that is connected
    BBP_LOCATIONS_GET_FROM_SYSTEM
    To get all the location numbers from one particular backend system
    BBP_LOCATIONS_GET_SELECTED
    To get selected locations
    Previously, locations were not given business partner numbers in SAP Enterprise Buyer. If you are configuring an upgrade, you can use routines BBP_LOCATIONS_GET_FROM_SYSTEM and BBP_LOCATIONS_GET_SELECTED to check that the following conversions have been made:
    ·        Conversion of user favorites
    ·        Conversion of user attributes
    ·        Conversion of old documents
    Routine BBP_LOCATIONS_GET_ALL checks these automatically.
    Once you have run the routines, the location data is available in the SAP Enterprise Buyer system. Table BBP_LOCMAP contains the mapping information (in other words, which business partner number corresponds to which location in which backend system).
    For more information, see SAP Note 563180 Locations for EBP 4.0 – plant replication
    http://help.sap.com/saphelp_srm50/helpdata/en/62/fb7d3cb7f58910e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_srm50/helpdata/en/77/e97b3c91c1eb1ee10000000a114084/frameset.htm
    10. PPOCA_BBP(Create) / PPOMA_BBP(Change) / PPOSA_BBP(Display).
    Regards
    - Atul

  • Basic SSO question

    I'm a little puzzled by the "Basic SSO" option (ie: <SSOVendor value="50"/>) .. the admin guide mentions that "...the Portal Server can derive authentication information from the remote authenticationsource or LDAP configuration source.."
    what does this mean in practice? does it mean that the portal can pull in password info from AD and make credentials available to portlets so we get the best of both worlds - credentials passed to portlets and the user not having to specifically login (or is this just wishful thinking??) .. if so, how would this be set up?
    thanks in advance
    Simon

    Yes ..It is possible but with lot of constaints
    With regard to your dual-stack, when installed, if they share the same SID (Java and ABAP were installed as a combined system), I am pretty sure that you cannot break this away from ABAP authentication
    check below thread for constraints in implementation
    SPNego authentication mode on WAS with ABAP stack
    check these for more information
    Spnego for ABAP WAS
    Configuring and troubleshooting SPNego -- Part 1
    Configuring and troubleshooting SPNego -- Part 3 troubleshooting
    check below blogs for configuring and troubleshooting
    Configuring and troubleshooting SPNego -- Part 1
    Configuring and troubleshooting SPNego -- Part 3 troubleshooting
    Points are welcome if it is helpful
    Koti Reddy

  • Basic swing question

    I just started looking at swing yesterday because I want to provide a GUI to replace a command line utility we use. I've basically finished it but have a quick question about form - I will get some literature later but would like to get a feel from the people here. If you have a JFrame with a few JPanels each which contain some other components, what is the best practice for variable declaration? Should I just declare the variables locally or should I make them instance variables? The reason I ask is that I have a button that submits a message but that message is dependant on check boxes, etc. from from the frame. If I declare them at the method level I then have to start passing them around whereas if I declare them as instance variables I can access them very easily BUT this may not be good form.
    For example:
    my class is SendMessageToo so in the main method I have a line like:
    final SendMessageToo smt = new SendMessageToo();
    now all the instance variables that I have can be accessed my the methods simply using smt.methodOne(), etc. Does that seem OK or is it just pure crap? :-)

    Thanks, that was something that crossed my mind before I just made eveything an instance variable. It was during that process that I thought, do these all need to be instance variables? Then I thought, SHOULD they all be instance variables. At that point my brain imploded so I came here. :)

Maybe you are looking for