How do I modify a specific component within a active internalframe?

I need to change an icon (toggle like) on a button within an internal frame when it is pressed.. I know what the active frame is. How do I address the specific component (wiithin a deskpane within a internalframe)?
Thank you in advance,
BAJH

Here is a stripped down version of the program:
i
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.OverlayLayout;
import javax.swing.ScrollPaneConstants;
import javax.swing.UIManager;
import javax.swing.event.InternalFrameEvent;
import javax.swing.event.InternalFrameListener;
public class TestFrameButton extends JDesktopPane{
     private static final long serialVersionUID = 1L;
     JDesktopPane desk;
     JDesktopPane ifdesk;
     JScrollPane scrollpane;
     JInternalFrame iframe;
     JFrame frame;
     JList jList1;
     JInternalFrame currentframe;
     Integer currentframenumber;
     String currentframename;
     Boolean[] downuptracker;
     Integer deskwidth = 1000;
     Integer deskheight = 1000;
     Integer scrollwidth = 1000;
     Integer scrollheight = 1000;
     JButton DownUpButton;
     public static void main(String[] args) {
          TestFrameButton d = new TestFrameButton();
     public TestFrameButton(){
          downuptracker = new Boolean [99];
          frame = new JFrame("Test Frame Button");
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          scrollpane = new JScrollPane(desk,
                    ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
                    ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
          scrollpane.setPreferredSize(new java.awt.Dimension(scrollwidth, scrollheight));
          desk = new JDesktopPane();
          desk.setPreferredSize(new java.awt.Dimension(deskwidth, deskheight));
          int i = 5;
          for (int j = 0; j <= i; j++){
               UIManager.getDefaults().put("InternalFrame.icon", "");
               iframe = new JInternalFrame("Internal Frame: " + j, false, true, false, false);
               iframe.setName(String.valueOf(j));
               iframe.setBounds(30*j, 30*j,265 , 80);
               iframe.addInternalFrameListener(new InternalFrameListener(){
                    public void internalFrameClosing(InternalFrameEvent e) {
                    public void internalFrameClosed(InternalFrameEvent e) {
                    public void internalFrameOpened(InternalFrameEvent e) {
                    public void internalFrameIconified(InternalFrameEvent e) {
                    public void internalFrameDeiconified(InternalFrameEvent e) {
                    public void internalFrameActivated(InternalFrameEvent e) {
                         currentframe = e.getInternalFrame();
                         currentframename = e.getInternalFrame().getName();
                         currentframenumber = Integer.valueOf(currentframename);
                    public void internalFrameDeactivated(InternalFrameEvent e) {
               iframe.setTitle("Internal Frame :" + j);
               iframe.setVisible(true);
               downuptracker[j] = true;
               ifdesk = new JDesktopPane();
               iframe.getContentPane().add(ifdesk, BorderLayout.CENTER);
               DownUpButton = new JButton("Old Icon here");
               ifdesk.add(DownUpButton);
               DownUpButton.setBounds(0, 0, 130, 20);
               DownUpButton.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                         if (downuptracker[currentframenumber].equals(true)){
                              // Colapse frame here and change icon
                              DownUpButton.setText("New Icon here");
                              downuptracker[currentframenumber] = false;
                         }else{
                              // Expand frame here and change icon
                              DownUpButton.setText("Old Icon here");
                              downuptracker[currentframenumber] = true;
               desk.add(iframe);
               iframe.moveToFront();
          scrollpane.setViewportView(desk);
          JPanel overlayPanel = new JPanel();
          OverlayLayout overlay = new OverlayLayout(overlayPanel);
          overlayPanel.setLayout(overlay);
          this.setOpaque(false);
          desk.setOpaque(true);
          overlayPanel.add(this);
          overlayPanel.add(scrollpane);
          frame.add(overlayPanel);
          scrollpane.setVisible(true);
          frame.setSize(800,600);
          frame.setVisible(true);
}Thank you in advance,
BAJH - I will never multi-post again!

Similar Messages

  • How do I modify an arbitrary component value during a simulation?

    I am a new Multisim user, beginner SPICE user, but with some undergrad and graduate EE coursework, and some "real world" experience, but I don't pretend to be an EE by long shot. 
    I am moving to Multisim from a competitor. In the competition, I can open a tab with all the components in the schematic and their values, including various SPICE model parameters  and can modify these while the simulation is running. 
    For example, I can change a resistor without adding a potentiometer. This affords much quicker simulation response and keeps the schematic very clean and clear.
     Can Multisim do this? I have not been able to find any information regarding this interactive control of component values and SPICE parameters while a simulation is running.
    David
    David M. Ingebretsen, M.S., M.E.
    Collision Forensics & Engineering, Inc.
    [email protected]
    www.CFandE.com

    Yes. The software is B2 SPICE by BeigeBag software:
    http://www.beigebag.com/
    Attached is a grab of the "properties" tab for modifying parameters during the simulation. It is very easy and useful. Since teeh components are "static" it doesn't add to the overall simulation overhead. I'm not sure how the author actually programmed this feature, but it is useful as you can add standard fixed components and simply change the value of any component in the circuit during the simulation.
    David M. Ingebretsen, M.S., M.E.
    Collision Forensics & Engineering, Inc.
    [email protected]
    www.CFandE.com

  • How to read/unzip a specific file within a zip file

    Hi,
    I have a file within a zip file that contains a timestamp - I want to read this timestamp and then create a destination directory for the remaining zip files to be unzipped into. Since I know the name of the file with the timestamp in it I thought I could create a zipfile and use getEntry to get the entry but then other than getting the size and name of the file I can't do much more with it like read it unless I use a stream (zipinputstream) instead of a file (zipfile) - do I have this right?
    Does this mean to get the content I would have to loop through possibly all the files using the stream until I come across the one I want - then get the timestamp and loop through them all again to write them to the destination directory? Or am I reading this wrong - seems a bit round about.
    Any suggestions would be greatly appreciated.
    Thanks

    this works though - and you don't have to loop through all the files - just use the ZipFile:
    ZipEntry ze = zipfile.getEntry("path/to/file");
    BufferedReader br = new BufferedReader(new InputStreamReader(zf.getInputStream(ze)));
    line = br.readLine;Thanks!

  • How to search for a specific String within an ArrayList

    I am creating an inherited class, CD, that has a field of "tracks". I am wondering how you would search through the ArrayList and list the track number that correlates with a search term. For instance, if I have a track called "Radar Love" and it is track number 2, how would I create the search function to find out what track number "Radar Love" is?

    trojansc82 wrote:
    int index = 0;
    boolean found = false;
    while(index < tracks.size() && !found){
    String track = tracks.get(index);
    if(track.contains(searchString)){
    found =true;
    else{
    index++;
    return index;It's still the same code. I attempted putting in a return statement with tracks.get(index), but it didn't work.Edited by: Edward_Kimber on Nov 15, 2008 2:57 PM

  • How can I copy a specific sentence within an iMessage on my iPhone?

    Everytime I try to copy a word or a sentence from an iMessage, it only allows me to copy the entire message.  I do not have the ability to select words or sentences like I do in a webpage or within notes.

    Copy from Messages.
    Paste into Notes.
    Copy the desired sentence from Notes.
    Paste as desired.

  • How to Executing a Specific RuleSet within a Dictionary on Oracle Business

    Hi All
    How does one explicitly execute a specific ruleset in a Oracle Business Rules dictionary?
    While using the Business Rules Component inside our composite application(in JDeveloper), the only options available are:
    · Service: Decision Service name
    · Dictionary Name: The name of the dictionary that you want to use.
    · Name: Business rules component name.
    There is no section where we can select to execute only a specific rule set within a dictionary.
    Is this fuctionality not supported or is there a way around this, where we could be able to execute a specific ruleset within a dictionary?
    Regards
    Emmanuel

    You get to choose the option of the Rule Dictionary When dragging in BPEL, if you have already built the bpel process with the rules call, you can do the following
    --> Open the .rules file in the Jdev
    --> Go to the Decision Fucntions Tab
    --> Select the decision function in the list( by default there would be only one)
    --> click on the edit icon
    --> In the bottom you would get to select the Rule Sets you want to be included in this function call(BusinessRulesSets to be included as part of the call)
    --> This would cater your requirement.
    Regards,
    Ajay

  • How can I find the specific channel name and modify channel name in automatically in VBS?

    How can I find the specific channel name and modify channel name in automatically in VBS? (DIAdem 9.1)
    I would like to change channel name = "speed01" ... "speed10"  to  channel name = "velocity01"..."velocity10.
    martino

    Hello Martino,
    this script will help:
    Option Explicit
    Dim i
    Dim n
    For i=1 To 10
    If i < 10 then
    n = CNo("speed0" & i)
    Else
    n = CNo("speed" & i)
    End If
    If n > 0 Then
    If i < 10 then
    ChnName(n) = "velocitiy0" & i
    Else
    ChnName(n) = "velocitiy" & i
    End If
    End If
    Next
    Matthias
    Matthias Alleweldt
    Project Engineer / Projektingenieur
    Twigeater?  

  • How to find which component has a partial trigger to a specific component

    Hi,
    Not sure if this question has been posted earlier. Apology for repeating, but I need to know how to do this and could not find the answer by searching the forum.
    I want to know if there is a way to find out what all components that use a specific component in its partial trigger. So lets say I have two selectoneChoice.
    <af:selectOneChoice id="soc1" autoSubmit="true"
    value="parent"
    />
    <af:selectOneChoice id="soc2" autoSubmit="true"
    value="child1" partialTriggers="soc1"
    />
    <af:selectOneChoice id="soc3" autoSubmit="true"
    value="child2" partialTriggers="soc1"
    />
    There is the soc2.getPartialTriggers() method that gives on the partialtriggers on soc2. However, I want to know how can soc1 know who all are using it as their partialTriggers.
    Appreciate any clues and help.

    because i want to add a common valuechange listener method in my backing bean on the parent component that will update all its child components with a specific same value.

  • How to find out if a panel contains a specific component

    I am in a situation where i need to know whether a panel contains a specific component or not, like is there a specific method for that.
    To clarify, example :
    Suppose i have a panel
    JPanel p1;
    p1 = new JPanel();
    JLabel label = new JLabel("LABEL");
    p1.add(label);In this code i already know that p1 contains label, however at runtime, i would like to know if p1 contains label or not (assuming i removed the label at some point)

    verminator wrote:
    I thought that should have done the trick, and maybe it will, but did i do something wrong here :
    JPanel p1 = new JPanel();
    JLabel l1 = new JLabel("LABEL");
    p1.add(l1);
    if(isDescendingFrom(l1,p1))          //error here
    System.out.println("true");
    else
    System.out.println("false");
    }do you have to import some other package other than javax.swing.SwingUtilities for this method, because i'm getting an error "cannot find symbol" referring to the isDescendingFrom() methodSwingUtilities isn't a package, it's a class. isDescendingFrom() is a static method in that class.
    To call isDescendingFrom(), it should look like this:
    SwingUtilities.isDescendingFrom(c1, c2);

  • How do I encrypt my external hard drive and subsequently a specific file within it, using my Mac? I tried creating a disk image but permission was denied.

    Encrypting an external hard drive and specific folders within. Permission denied using disk image.

    VKP90 wrote:
    When I tried to encrypt a single file within the hard drive itself, I got the following: Disk Utility Progress: Unable to create "Name of my file" (Permission Denied).
    When I tried encrypting the entire hard disk itself, I got: A GUID Partition Table (GPT) partitioning scheme is required.
    I have also currently used Time Machine on the external hard drive, along with saving other data. Hence, I am not sure if partitioning is going to delete any of this (a video I watched mentioned that using the + button when creating partitions retains current data). Backing up the external hard drive is out of the option since it is the back up to my Mac.
    You can't encrypt a single file. I'm not sure what you did to try. You can make an encrypted disk image which begins with a folder, if desired. Or, you can just create a blank, encrypted disk image, then move your desired files into that.
    While you could partition off the free space without erasing the disk, you cannot encrypt it because you need a GUID Partition table which requires you to repartition the entire drive, not just the free space.

  • Executing a Specific RuleSet within a Dictionary on Oracle Business Rules

    Good Day,
    How does one explicitly execute a specific ruleset in a Oracle Business Rules dictionary?
    While using the Business Rules Component inside our composite application(in JDeveloper), the only options available are:
    · Service: Decision Service name
    · Dictionary Name: The name of the dictionary that you want to use.
    · Name: Business rules component name.
    There is no section where we can select to execute only a specific rule set within a dictionary.
    Is this fuctionality not supported or is there a way around this, where we could be able to execute a specific ruleset within a dictionary?
    kind regards

    You get to choose the option of the Rule Dictionary When dragging in BPEL, if you have already built the bpel process with the rules call, you can do the following
    --> Open the .rules file in the Jdev
    --> Go to the Decision Fucntions Tab
    --> Select the decision function in the list( by default there would be only one)
    --> click on the edit icon
    --> In the bottom you would get to select the Rule Sets you want to be included in this function call(BusinessRulesSets to be included as part of the call)
    --> This would cater your requirement.
    Regards,
    Ajay

  • How to use  modify command?

    i want to modify table t_bseg which is used n BTE interface_00001050
    i want to modify only 1 specific line, how can i modify this line without using index because i get 0 when i use sy-tabix?
    ( i want to modify this line using the table keys ) .
    thanks

    Hi,
    MODIFY TABLE <itab> FROM <wa> [TRANSPORTING <f1> <f 2> ...].
    Check this link:
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3ac8358411d1829f0000e829fbfe/content.htm
    Regards
    Adil

  • How do you modify the web.xml to lock down the pages from a user role

    how do you modify the web.xml to lock down the pages from a user role

    I'll make a stab at your question:
    The following is an example of where a URL is protected within a web.xml deployment descriptor. In this example, the URL /protectedA within the application is protected:
    <!-- security constraints -->
    <security-constraint>
    <web-resource-collection>
    <web-resource-name>protectedA</web-resource-name>
    <url-pattern>/protectedA</url-pattern>
    </web-resource-collection>
    <!-- authorization -->
    <auth-constraint>
    <role-name>sr_developer</role-name>
    </auth-constraint>
    </security-constraint>
    Sun's explaination here:
    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/Security4.html

  • How do I find out what program / file is using 100 GB of space on my Hard drive?  Once I find the problem  how do I delete the specific files to increase GB of space?

    How do I find out what program / file is using 100 GB of space on my Hard drive?  Once I find the problem  how do I delete the specific files to increase GB of space?

    Use OmniDiskSweeper
    Once you find file, it can be deleted from within OmniDiskSweeper
    Allan

  • How can i reference a MIME object within a correspondence format through...

    how can i reference a MIME object within a correspondence format through TX oofo or se71?
    Hi, I need to put a MIME object within a correspondence's format that i've already done through Tx oofo. My problem is, that i don't know exactly how can i make the reference of that MIME object in the format? and What structure type do i have to use in order to make appear the MIME object in my correspondence's format? Does anybody can help me with this?   
    Regards    Hector

    Frank,
    I tried to find some examples/samples on how to create CollectionModel for a table component but not successful.
    Can you clarify the following ?
    1. "CollectionModel" is referenced only by af:table attributes "value", "selectedRowKeys" and "selectionListener".
    The rest of af:table attributes such as "rows", "fetchSize" used to reference the iterator binding in the binding container via the EL expression "#{bindings.VOIteratorBinding.xxx} .
    What should I replace that EL expression with?
    2. I heck out the bean method to create the CollectionModel as following, is it close to what you mean?
    public void initBusinessDataDashboardView() {
    OperationBinding operation = BeanUtils.getOperationBinding("getPanelBusinessData");
    Map params = operation.getParamsMap();
    Key panelKey = getPanelInfoView().getKey();
    params.put("panelKey", panelKey);
    params.put("maximizedView", false);
    panelView = (ViewObject)operation.execute();
    // Heck code to create CollectionModel
    RowSet rowSet = panelView.getRowSet();
    ArrayList rowList = new ArrayList();
    while (rowSet.hasNext()) {
    rowList.add(rowSet.next());
    model = new ChildPropertyTreeModel(rowList, null);
    // To be used to set up af:table value, selectRowKeys, selectionListener via EL expr #{backingBeanScope.MyBean.model.xxx}
    public CollectionModel getModel() {
    return model;
    Am I on the right track?
    Edited by: Pricilla on May 4, 2010 2:20 PM

Maybe you are looking for

  • Problems with a document

    I am trying to open an Excel document with Apple Works but when the Mac Link Plus is translating it the document doesn't respond. I have to force the program out. Where is the error? I need help please.

  • Trackpad won't work only on word

    My trackpad will not scroll down on word. It works perfectly fine except when I use word.

  • Hyperion Reports 11.1.2.2 database login issue

    HI , We are on Hyperion reports v11.1.2.2 , for some reason whenever user logged in and try to pull the report ..it is prompting for database user credentials for first time(first report). After that it wont ask for any other report. How to avoid thi

  • HT201303 I need to know how to reset my secutiy questions

    Im trying to download music and it ask me to answer the secutiry questions. I have forgotten them. I have gone to manage acccount but do not see a place to change or reset questions.

  • Curser jumping around in Microsoft Word ONLY!!!

    Ok I am using a desktop pc NOT a laptop. Every time I open Word to edit or create a document, my curser goes crazy!! I've read some of the solutions for this subject, but all of them were for laptops! I did make some changes to the mouse with no luck