Changing elements in a JScrollPane

Hi all,
I was wondering, is it possible to change the elements inside a JScrollPane. That is, say I had two buttons A and B. If I press button A, I would like the JScrollPane to display a JLabel in it, but If I press button B, I would like the scroll pane to display a JTree in it. All using the same scroll pane of course. Is this sort of functionality possible?
Thanks in advance.

scrollPane.getViewport().setView(...);

Similar Messages

  • How to change elements in ArrayList into String

    Greetings,
    i like to change elements in arrayList into string.
    This is how i declare an ArrayList in a Java file
    ArrayList listing = new ArrayList();below is just a simple example of how i insert the string into the arraylist
    String concat = "';
    concat = concat + "apple";
    //Transfer the concat string into arraylist
    listing.add(concat);
    return listing;
    {code}
    On my Jsp page, it will receive the ArrayList from the java file. Lets say the Arrayist is pass into my JSP arraylist
    This is my JSP arraylist
    {code}ArrayList optLists = new ArrayList();{code}
    Inside the arraylist element, it holds data eg: *308577;;RS | [CAT 2] Level: Arena, Section: A02* with a pipe between RS and CAT 2.
    Now i looping the arraylist
    {code}int a = 0;
         for ( a=0; a < optLists.size(); a++)
              String tempString = "";
              String splitTemp = "";
                     String tempString = (String)optLists.get(a);
              splitTemp =  tempString.split("|");
              System.out.println("Split String Results: "+ splitTemp);
         {code}}
    Heres the error:
    *SeatAvailable_jsp.java:560: incompatible types*
        *[javac] found   : java.lang.String[]*
        *[javac] required: java.lang.String*
        *[javac]             splitTemp =  tempString.split("|");*
        *[javac]*       
    What can i do to solve the problem?
    Edited by: leeChaolan on May 2, 2008 4:45 AM
    Edited by: leeChaolan on May 2, 2008 4:48 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    paternostro is right, you are returning an array into a string which is wrong
    but try this, i haven't tested it though..
    nt a = 0;
         for ( a=0; a < optLists.size(); a++)
              String tempString = "";
              String splitTemp = "";
                     String tempString = (String)optLists.get(a);
              String[] splitTemp =  tempString.split("|");
              for(String xyz : splitTemp)
                   System.out.println("Split String Results: "+ xyz);
         }Edited by: linker on May 2, 2008 1:17 PM
    Edited by: linker on May 2, 2008 1:18 PM

  • How change to English? Yosemite install on my computer. Change elements photoshop 10 to German language.

    How change to English? Yosemite install on my computer. Change elements photoshop 10 to German language.

    There is no way to change the language in Palm Desktop that I am aware of once it is installed.
    You may need to remove the current Palm desktop and then download an english version of PD.
    You can find the english version of PD here;
    http://kb.palm.com/wps/portal/kb/na/treo/650/unlocked/home/page_en.html

  • Someone is changing elements with the Dev tools on my computer how do i reverse the changes

    i am new to computers you could call me technically retarded sometimes my pages are padded and sometimes they dont work at all this part or that will be missing or i will get a ridiculous redirect i really dont understand it but im reading about it in the forums
    please help me it seems a touch suspicuous there are things encrypted with 256 encryption hidden photos and all kinds of other stuff
    sincerely
    James r fair
    Portland Or
    SalpareBay Marina
    8/30/2014

    Unknown property '-moz-border-radius'. Declaration dropped. 0:1
    Unknown property '-moz-border-radius-bottomleft'. Declaration dropped. 0:1
    Unknown property '-moz-border-radius-topleft'. Declaration dropped. 0:1
    Expected 'none' or URL but found 'alpha('. Error in parsing value for 'filter'. Declaration dropped. 0:1
    Unknown property '-moz-box-shadow'. Declaration dropped. 0:1
    Unknown property '-moz-border-top-left-radius'. Declaration dropped. 0:1
    Unknown property '-moz-border-top-right-radius'. Declaration dropped. 0:1
    Expected color but found 'top'. Error in parsing value for 'background-image'. Declaration dropped. 0:1
    Expected media feature name but found '-webkit-min-device-pixel-ratio'. 0:1
    Error in parsing value for 'image-rendering'. Declaration dropped. 0:1
    Expected color but found 'none'. Error in parsing value for 'background-color'. Declaration dropped. 0:1
    Error in parsing value for '-moz-transition'. Declaration dropped. 0:1
    Error in parsing value for 'transition'. Declaration dropped. 0:1
    Unknown property 'zoom'. Declaration dropped. 0:1
    Expected color but found 'right'. Error in parsing value for 'background-image'. Declaration dropped. 0:1
    Expected color but found 'bottom'. Error in parsing value for 'background-image'. Declaration dropped. 0:1
    Expected color but found 'left'. Error in parsing value for 'background-image'. Declaration dropped. 0:1
    Unknown property '-moz-background-size'. Declaration dropped. 0:1
    Expected color but found 'auto'. Error in parsing value for 'border-left'. Declaration dropped. 0:1
    Error in parsing value for 'border-right'. Declaration dropped. 0:1
    Unknown pseudo-class or pseudo-element '-ms-clear'. Ruleset ignored due to bad selector. 0:1
    Unknown pseudo-class or pseudo-element '-webkit-scrollbar'. Ruleset ignored due to bad selector. 0:1
    Unknown pseudo-class or pseudo-element '-webkit-scrollbar-button'. Ruleset ignored due to bad selector. 0:1
    Unknown pseudo-class or pseudo-element '-webkit-scrollbar-corner'. Ruleset ignored due to bad selector. 0:1
    Unknown pseudo-class or pseudo-element '-webkit-scrollbar-thumb'. Ruleset ignored due to bad selector. 0:1
    this is my gmail
    rocky fair
    portland or
    On Sat, Aug 30, 2014 at 12:32 PM, Mozilla Support Forum <[email protected]> wrote:
    Mozilla Support
    someone is changing elements with the Dev tools on my computer how do i reverse the changes
    cor-el Aug 30, 2014 5:32:47 AM
    Can you attach a screenshot?
    http://en.wikipedia.org/wiki/Screenshot
    https://support.mozilla.org/kb/how-do-i-create-screenshot-my-problem
    Use a compressed image type like PNG or JPG to save the screenshot
    Make sure that you do not exceed the maximum size of 1 MB
    This isn't done via the developer tools, but more likely by an extension or security software.
    You can try these steps in case of issues with web pages:
    You can reload web page(s) and bypass the cache to refresh possibly outdated or corrupted files.
    Hold down the Shift key and left-click the Reload button
    Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
    Press "Command + Shift + R" (Mac)
    Clear the cache and remove cookies only from websites that cause problems.
    "Clear the Cache":
    Firefox/Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    Firefox/Tools > Options > Privacy > "Use custom settings for history" > Cookies: "Show Cookies"
    Start Firefox in Safe Mode to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem.
    Switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance
    Do NOT click the Reset button on the Safe Mode start window
    https://support.mozilla.org/kb/Safe+Mode
    https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    Mark it as solved This doesn't solve my problem
    Browse for unsolved questions and help a Firefox user
    Solving 1 issue helps up to 1,000 users a day!
    This email is automatically sent by a robot. Our robot can’t respond to your question, but our forum contributors can! If you want to respond to them, please click here.
    Change your email preferences
    Unsubscribe from these emails

  • How can i change element's properties at specific time position?

    Hi, as the title describes, i want to change 'product_lg' position(left,top,width,height) at time position 'product_show' and 'product' automaticly, how can i do it with js?
    thanks!

    I known your solution, but i need to change it on trigger 'compositionReady' or 'compositionComplete', actually i want to init element's trigger effects at different time position automaticly.
    code as followed can change element's properties at current time, but it can't change element's properties at next coming trigger time:
    sym.$("Ellipse").css({'top':209, 'left':251, 'height':27, 'width':27});
    Thanks!

  • JSFL: Change element properties inside a library symbol?

    I'm trying to make a JSFL script to scan all the symbols in a library, find the text fields, and set useEmbeddedFonts = true.
    Actually, just backing up a second, assume there are instances on the stage.  Then I can use fl.findObjectInDocByType("text") to find all the text fields and inspect them to see their type, contents, etc.  But if I try to use one of the elements returned by that call to change the useEmbeddedFonts property, nothing seems to happen.
    Something like this:
    var texts = fl.findObjectInDocByType("text", doc);
    if (texts.length > 0) {
        for (var i = 0; i < texts.length; i++) {
              if( texts[i].obj.textType != "static" &&  texts[i].obj.useDeviceFonts == false )
                   fl.trace("Setting text field to use device fonts: " + texts[i].obj.name);
                   texts[i].obj.useDeviceFonts = true;
    It seems to have no effect on the text fields.  They are still set to anti-alias.
    Ok, so assuming that problem can be overcome, to deal with symbols in the library, I was thinking of running through the library items and creating instances of them on the stage, then using the findObjectInDocByType to update them, assuming this will actually change the symbol and not just the instance.  But I don't see how to actually create an instance of a symbol on the stage, which seems like it should be easy.
    Or, is there some other way of introspecting the library symbols to find the text fields and modify them directly?  This would have to handle cases like button symbols where the text field is inside the symbol, not a symbol itself...

    altenbach wrote:
    One of the elements could be a 2D picture indicator of about the same size. You can write text in any color using picture functions.
    Here's what I had in mind. Seems to work just fine (I would fine-tune the font, picture border, etc. but this should get you started).
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    ColorText.png ‏13 KB
    ColorText.vi ‏9 KB

  • Duplication of a template with a unique changing element

    As part of audiobook creation disc labels are created.  A master template is created for the general format and then adapted for each unique title.  However, most titles have multiple CDs (up to 30 or 40 discs).  Need to find a way to carry every element of the master over except for the numbering sceme, which would auto change per disc.  For example.  One would enter that the book is 30 discs.  Then a process would create 30 copies of the template with all of the stock template info but would show disc 1, disc 2, disc 3, etc for each procceding file.  Each file is then turned into a PDF.  So if the process could include automation for PDF conversion that would be a bonus.  Thanks.

    Hi alruden2,
    For the first issue of needing to duplicate the effect, it seems you don't have to do that to fix it -- just change one of your popup values to something else, then back to its previous value. We're trying to figure out why the duplicate of the comp is causing a different result, though.
    As for the issue of "FilterComp2Comp" and "FilterComp2" rendering differently, it's probably because each has your PB effect applied.
    As for your crashes, do they show the Adobe Crash Reporter dialog? If so, please do fill out the form and provide as much information about what you were working on and doing at the time. Include your e-mail address in case we need to contact you for more details.
    Thanks,
    Jeff

  • Change element type of an array of containers (from LabVIEW)

    Hi,
    I have an empty Array of Container type and need to insert an element of a custom data type definition. If I already have an element of the type definition, it is simple to copy that element and insert it as a new element. But inserting a new element to a empty array I need to specify that the element should be of this data type.
    Getting the type definition with the Method "GetTypeDefinition" and inserting this as a new value simply "moves" my type definition to the inserted element (which is not suppose to happen). Can't find a method to change data type and seems that none of the property options does the trick to.
    I just need to do the same as "change type" in the TestStand editor, just inside LabVIEW.
    What did I miss??
    Thanks
    Note: Use edit of the step in the attached sequence file. Collapse and expand "Locals" after running the Edit function to see the result.
    Attachments:
    InsertElementInArrayOfContainersOfTypeDef.seq ‏5 KB
    InsertArrayElement.vi ‏35 KB

    Hi,
    When i am writing my stuff i was not able to open your SequenceFile. Now i was.
    My upper example is only working for arrays of Types. It is also working on empty Arrays, too.
    Please tell me why you do not use an array of types ?
    Regards
    Juergen
    =s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e=

  • How do I change elements values with DOM?

    Hi, I'm trying to get to understand the DOM tutorials but I'm struggling with some things.. Basically I need to take an xml structure, read it and then change it to another xml structure. For instance, if I have the html sentence:
    <p id="id10">One flight was found </p>
    I would like to change it to a vxml sentence like
    <vxml:prompt vxml:id="id10" vxml:bargein="false">One flight was found.</vxml:prompt>
    And I need to do that to an entire file. I can read the html with the DOM (I'm following the http://java.sun.com/webservices/jaxp/dist/1.1/docs/tutorial/dom/index.html tutorial) and show it without troubles, but I don't know and I can't find the functions that would allow me to modify the values. By values I mean both the element tags such as converting <p>..</p> to <prompt>..</prompt> and the attributes (like the id attribute). Could anybody help me here please?

    Thanks for that, but still can't do it. I'm using Xerces as you suggested. The following chunk is not actually what I need to do but I can't manage to get it working either. Shouldn't this:
    Document doc= new DocumentImpl();
    Element item = doc.createElement("name");
    item.setNodeValue("nameChanged");
    change the <name> tag to a <nameChanged> tag? When I output it it's still <name>.
    I'm getting awfully confused with all the factories and models (yes, sorry, quite a newcomer, but I still need to do this somehow). If the following task is not too long/troublesome, could somebody please help me out with the code? Imagine you have a file with the content:
    <label id="1">Hello</label>
    and using xerces you want to create another file, without changing the first one, with the content:
    <anotherLabel id="1">Hello<anotherLabel>
    Edited by: victorNik on Sep 13, 2007 6:02 AM

  • Changing Element Attribute Values

    I spent far to long trying to figure out how to change an element attribute value without the FDK's SetAttributes function, so I thought I'd spare someone else the time.
    Basically, you still get the attributes using the GetAttributes() function, but now you just set the beg.child.Attributes property to the updated attribute value.
    //starting with a selected element
    elemSelect=app.ActiveDoc.ElementSelection
    //get the current attributes
    var childattributes =elemSelect.beg.child.GetAttributes()
    //find the attribute and value you want to change, and change it to a new value.
    childattributes[0].values[0] = "New_Value"
    //now assign the edited attributes to the selected element.
    elemSelect.beg.child.Attributes=childattributes
    Depending on how you selected the element, I assume you could do the above with beg.parent as well, but it wasn't something I needed to consider.
    ~Christen

    Thanks for this--you've likely saved me a headache.
    While I hadn't hit this yet, it does apply to several of the projects on my to-do list. Based on the info in the OMV, I would have expected to be able to simply use a statement like myElement.Attributes[i].value[i] = "New_Value" which, as I'm sure you discovered, has no apparent effect at all.
    The other thing I noticed in my quick testing is that defining your attributes variable by using the method (x = myElement.GetAttributes()) or by referenceing the Attributes property (x = myElement.Attributes) seem to be functionally equivalent.

  • Screens: Change Element type

    Hello experts,
    I need to change a number of types of screen elements on an existing screen for example   a checkbox to an input/output field and checkbox to a dropdown list box.  Please advise if SAP allows this as the screen element types are greyed out .....maybe the only way is to delete the sub-screen and create it again using the correct screen element types.
    Thanks

    Hello WDABAP,
    Would I find this screen exit in the flow logic for this particular screen and if so would it be in the SAP function module used before output.

  • Word Automation Services Changing element in the output Document - Sharepoint 2013

    Hi,
    We are currently running Sharpoing 2013 with Word Automation Services,
    We have documents that we send to WAS for conversion, however the output of those documents have their styling, fonts and currency values changed where display of the currency gets changed to right to left.
    The issue started when we had Arabic installed as a proofing language however nowhere in the document did we have Arabic set,  we have since removed the language from Word, however it seems that just having the language installed has altered some element
    in the document properties that causes WAS to change the document.
    Please advise?

    Hi Faiez,
    What did you mean by “having the language installed has altered some element in the document properties”?
    Is there any difference when you view document directly before and after doing conversion?
    For this issue, I recommend to do the steps below for narrowing down the issue scope:
    Create a new document and upload it to SharePoint to do the conversion, then compare the results.
    Test the Word Automation Services in another web application to see how it works.
    Check if the Disable embedded fonts is set to Yes. If yes, set it to No and then check the results.
    Thanks,
    Victoria
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Changing Element Class with Timeline Trigger

    Hey all,
    How can I change a div's Class from a trigger action?
    I've tried this but it didin't worked:
    var element = sym.$("Rectangle").addClass("My_Class");
    Please help me with this, thank you.

    Hi there,
    bo737 wrote:
    But I can't change an element's class with the same way (with jquery commands) just like:
    .addClass('newClass');  or,
    .toggleClass('change_me newClass');  or,
    .attr('class', 'newClass');
    What am I missing?
    Those all should work (except I believe a missing comma in your toggleClass() example), so perhaps something else is going wrong?
    You can verify whether the class is there by using the .hasClass() method after assigning a class.
    hth,
    Joe

  • How to change element in many pages and export to pdf?

    Hi guys!
    I've got a lot of Pages files with some text and graphic in the footer.
    I'd like to change this footer in all of them instantly and then export modified files to pdfs.
    Is that possible?

    I've tried but chosen not the best way..
    That's how I do it:
    1. Opening few Pages files (with editable footer)
    2. Copying every single pages to one Pages file.
    3. Editing footer in all of them instantly.
    4. But I'm exporting edited pages as one big PDF... And I want to export them seperately of course.
    Any idea how to do it fast and easy? Working with 100 files is real pain.
    Thanks for any help!

  • Dynamically changing elements in an array of menu ring controls

    I have an array (32 rows, 5 columns) of menu ring controls.  When a menu selection is made in the first column of any given row, the contents of the menu ring for the subsequent columns (same row) may change.  If this is possible, how would you do it?  Thanks.
    Solved!
    Go to Solution.

    jschichl wrote:
    For example, if I had a menu ring of 1,2,3,4.  I want to write some logic that says when 4 is selected, then menu ring in the next row changes to 5,6,7,8.
    A ring is just a number as far as LabVIEW is concerned, so the underlying cluster need only store numbers, not rings.
    In the example I posted in a linked thread, where controls are moved around on top of a table, you need only one ring control. Each time you show that ring, you can assign a new set of strings and values to it, using the Strings and Values property. You can decide what set of strings to show based on the existing data in the cluster, which will get updated each time you change the value in a cell of the table. Does that make sense? I don't have time right now to put together a more detailed example than what I've already uploaded in other threads, and it's only a small change to that.
    You update the menu ring at the time the user wants to select a value from it, not at the time the user changes the value that determines what set of menu items to show.

Maybe you are looking for

  • IPhone 3G no longer works after attempt to upgrade to 2.0.1

    Hi all, I have a black 16 GB iPhone 3G on a contract with Vodafone Australia. Last night I attempted to upgrade the firmware through iTunes to 2.0.1, after getting the latest security update and version of iTunes (7.7.1 I think it is). Anyway, the iP

  • In grid edit

    I have a table control which contains several columns. one of those columns contains an auto complete control. the view binded to the autocomplete is binding correctly, however, it seems like every row retrieves the same records from the db view. it'

  • MBP won't start from Disk Warrior CD and now won't restart at all.

    I tried starting my MBP from DW CD and I keep getting screen with Terminal type font and a message that says I need to restart my computer. When I restart I get the same screen over and over. (Now typing on iPhone so bare with me!)

  • Help required with optical drive issues on a 2008 Mac Book Pro

    I've got a problem with my Optical Drive not accepting CD, DVD etc. All the disks I put in just whirr around for a few seconds and then spit out the discs. First I've read on loads of discussion forums that the symptoms said the optical drive was cap

  • Migration Assistant Continue button does nothing

    I needed to backup my entire computer to Time Machine and restore (per a Bootcamp error message), but thats not my major concern right now. I am getting the same error as this guys: http://discussions.apple.com/thread.jspa?threadID=2269548 Which is,