Error in pop up menu: continuously running

hi
i m a greenhorn 2 labview n now i got problem with the pop up menu..When i run my VI,the pop up menu works but then after i typed in the data, it didn't close by itself n the vi hanged, i hav to close all the VIs.i m using Labview 8.0. My program is that if i click on my first boolean,i want the pop up menu activates and i wana  save the data in spreadsheet file that i keyed in.Likewise,if i click on the second boolean, i want e program 2 function as i mention earlier. and that file hav to b able 2 retrieve bak wen i recall..can somebody guide me???
i alr tried lots of examples fr forums but i still cannot find the relevant result..thanks a lot in advance..
i attached my files below before and after adding the dialog box!!
Attachments:
myproj.vi ‏108 KB
myproj_2.vi ‏110 KB

Just for the suggestion of a "2D array of booleans" I quickly cooked up a simple example (actually two examples).
First a more direct translation of your code logic (2DArray2.vi), jumping through some hoops to parse the complicated numbering system (e.g. 11-> 1-1, 23->2-3, 1010->10-10, 102->10-2, 310->3-10, etc). I did not treat your "special handling" of 1..10, so use 11..110 instead for these Rooms.
If it would be easier to start counting at zero, so we have 00-99 (->0-0..9-9) and the code is simpler (2DArray.vi).
(All examples are in LabVIEW 8.0)
Both codes are certainly easier than a case structure containing 100 cases, each with an indicator and 99 local variables )
(see also http://forums.ni.com/ni/board/message?board.id=BreakPoint&message.id=3269#M3269 )
Message Edited by altenbach on 01-25-2007 11:39 AM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
2DArray.vi ‏22 KB
2DArray2.vi ‏26 KB

Similar Messages

  • I occasionally get error messages popping up when I run Firefox 7. The messages often say "Exc in ev handl: TypeError: oSAPlg.oRoot.log is not a function". does anyone know how to fix this?

    After I downloaded and installed the latest version of Firefox, I started getting these error messages every so often when I launched the browser. These messages will usually pop up every third time or so I open the browser and pop up on every page, sometimes multiple times, and I have to clear them away before I can do anything on the page. The message usually reads "Exc in ev handl: TypeError: oSAPlg.oRoot.log is not a function". Is there any thing we can do to fix this?

    Please see solution in http://kb.mozillazine.org/Problematic_extensions
    for "McAfee Site Advisor".
    (Windows): For best results you should uninstall '''McAfee Site Advisor''' from Control Panel > add/change programs (Programs and Features). Reboot the system. Then Reinstall from http://www.siteadvisor.com/ and reboot the system. When installing refuse other suggested (crapware) applications.
    <br><small>Please mark "Solved" one answer that will best help others with a similar problem -- hope this was it.</small>

  • Show Pop-Up Menu error

    I'm having a problem with my site menu. The site works off a
    template and all links are created in the template. I have a
    central menu bar with rollover buttons, each with their own
    drop-down menu (using the Show Pop-Up Menu behavior). When tested
    in the browser, the menu drops down on mouse-over as it's supposed
    to, but when the links in the drop-down menu are clicked on, an
    error page comes up. The directory path specified in the Pop-Up
    Menu behavior is correct, but changes inexplicably when tested in
    the browser. All other links in the site (not in drop-down menu
    format) function as they're supposed to. I have no clue how to fix
    this problem. I think there may be a script error in the mm_menu.js
    file which is automatically created by Dreamweaver, but am not sure
    how to go about correcting this. Any ideas?

    > When creating pop-up menus everything works fine
    You just think. Read this (written by the person who adapted
    the original
    Netscape code for Macromedia) -
    http://www.losingfight.com/blog/2006/08/11/the-sordid-tale-of-mm_menufw_menujs/
    Those menus are a plague.
    Anyhow, try this -
    Troubleshooting JavaScript errors in Dreamweaver
    http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_19105#dat
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "montagrc" <[email protected]> wrote in
    message
    news:f2uhti$m9b$[email protected]..
    > When creating pop-up menus everything works fine,
    however, when I need to
    > go in
    > and edit a link, this error keeps occuring:
    >
    > "When executing inspectBehaviour in Show pop up
    menu.htm, the following
    > Javascript error(s) occured:
    >
    > At line 492 of file "C:\...Dreamweaver
    > 8\Configuration\Behaviours\Actions|Show
    > Pop -up Menu.js";
    > TypeError: T.update is not a function."
    >
    > Anyone seen this before, noone in my workplace has, nor
    has googling
    > yielded
    > any answers. Any thoughts/ideas/help greatly
    appreciated.
    >
    > Using Dreamweaver 8, no extensions, update 8.02
    >

  • Pop up window doesnt closing during continuous run

    i have developed pop up window for my application... im getting the pop up window to condition in my application... im facing the problem in closing the the pop up window during continuous run, wen i click ok its not closing in continuous run... can any one help me.. im attaching my file please check and give me the solution
    Attachments:
    POP MAIN.vi ‏11 KB
    POP SUBVI.vi ‏6 KB

    ok..If you carefully look at the vi you will come to know the answer for your question.
    The reason is because when the value of the slider becomes greater than 8 the pop up will appear and when you close, it will close (for say i=1). Now again the pop up will appear and close when you hit the close button. (say for i=2).
    This operation will continue unless and until some one will change the value of the slider to be less than 8. or the vi is aorted
    Also do not use the contineous run button unless and until you are debugging something. Instead use a while loop.
    A better approach would be to use a event structure wired with a valus change event for the slider.
    Regards
    Guru (CLA)

  • I keep trying to download the Photoshop free trial on my windows xp but an error message that says "You are running an operating system that Photoshop no longer supports" pops up, any idea why?

    i keep trying to download the Photoshop free trial on my windows xp but an error message that says "You are running an operating system that Photoshop no longer supports" pops up, any idea why?

    Because Photoshop CC requires Windows 7 or above...
    See the System Requirements.

  • JComboBox event notification when select first entry in pop-up menu JDK 6

    I recently began testing a Java GUI, I originally developed with JDK 1.5.0_11, with JDK 1.6.0_3. I have used the JComboBox in several applications developed using JDK 1.3.x and 1.4.x over the years. In every one of these earlier JDKs the JComboBox widgets all behaved the same. When you select the JComboBox widget, the pop-up menu appears and you can select any of the items from the menu list. Having made the selection with either a mouse click or a key press, an event notification is sent. Typically, an ActionEvent as well as either a mouse click event or a keypressed event may be sent. When testing with 1.6.0_x versions of the JDK and JRE, I can't account for any event notification being sent when selecting the first item at the top of the pop-up menu as the initial selection. If I select some other item on the list and then the first item, it works as it is supposed to work, but only after selecting another item first.
    I've placed the JComboBox in a JDialog and a JPanel. There are NO AWT widgets in any containers of the application. The same behavior seems to exist regardless of what other containing Swing component I place the JComboBox in. I'm running these applications on Windows XP, service pack 2. The system is an AMD 64 bit dual processor with 4Gb of RAM. The essential code follows:
    private JComboBox getJcboAlias()
        /* Note here that I am using a defaultComboModel as I have always done */
       jcboAliases = new JComboBox(urls);
       *jcboAliases.setEditable(false);*                               // Note here that the JComboBox is NOT editable
       jcboAliases.addActionListener(new ActionListener()   // ActionListener only receives a notification if the second or
       {                                                                            // another item in the pop-menu list is selected...but never the
          public void actionPerformed(ActionEvent ae)           // first item in the list
             String s = (String) jcboAliases.getSelectedItem();
             for (int i = 0; i < connections.size(); i++)
                conAlias = (String[]) connections.get(i);
                if (s.equals(conAlias))
    isSelected = true;
    break;
    jlblName.setVisible(true);
    jlblAlias.setVisible(true);
    jlblUID.setVisible(true);
    jlblPWD.setVisible(true);
    jtxtName.setText(conAlias[0]);
    jtxtName.setVisible(true);
    jtxtAddress.setText(conAlias[1]);
    jtxtAddress.setVisible(true);
    jtxtUID.setText(conAlias[2]);
    jtxtUID.setVisible(true);
    jtxtPWD.setVisible(true);
    jtxtPWD.setText("");
    jtxtPWD.requestFocus();
    return jcboAliases;
    }    I'm using a non-editable JComboBox because there is a pop-up menu with this and not with the JList widget.  JComboBox behaves more like the JList MicroSoft counterpart.  Another code snippet follows in which the JComboBox is editable.  The same errant behavior occurs when selecting the first item from the pop-up menu: private JComboBox getJcboPCMember()
    jcboPCMember = new JComboBox(PCViewerCustom.getCurrentMembers());
    jcboPCMember.setBounds(250, 103, 180, 20);
    jcboPCMember.setToolTipText("PATHCHECK(ER) member name - Example: CKPPTHCK");
    jcboPCMember.setSelectedIndex(Integer.valueOf(PCViewerCustom.getCurrentHost(3)));
    jcboPCMember.setEditable(true); // Note here that this JComboBox IS editable
    jcboPCMember.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent ae)
    if (ae.getActionCommand().equals("comboBoxEdited"))
    boolean copy = false;
    for (int i = 0; i < jcboPCMember.getItemCount(); i++)
    if (jcboPCMember.getSelectedItem().equals(jcboPCMember.getItemAt(i)))
    copy = true;
    break;
    if (!copy)
    if (jcboPCMember.getItemCount() > 0)
    if (jcboPCMember.getItemAt(0).equals("No Entries"))
    jcboPCMember.removeItem("");
    jcboPCMember.removeItem("No Entries");
    jcboPCMember.insertItemAt((String) jcboPCMember.getSelectedItem(), 0);
    else
    jcboPCMember.removeItem("");
    jcboPCMember.addItem((String) jcboPCMember.getSelectedItem());
    enableJbtnOK();
    else
    if (jcboPCMember.getSelectedIndex() >= 0)
    PCViewerCustom.setCurrentHost(3, Integer.toString(jcboPCMember.getSelectedIndex()));
    enableJbtnOK();
    else
    JOptionPane.showMessageDialog(null, "Name not selected", "Error", JOptionPane.ERROR_MESSAGE);
    return jcboPCMember;
         I am able to add a new entry to the JComboBox, however, I am still unable to select the first item from the pop-up menu and fire any kind of notification event.  I have not seen this behavior before in any earlier versions of the JDK and it's playing havoc with my ability to deploy the application into a JDK or JRE V6 environment, without adding a bunch of additional code to pre-select the first item on the list, which pretty much defeats the purpose of the JComboBox.  I'll be the first to admit I've done something wrong, but i've built a number of test scenarios now on two systems runing Win XP SP2 and I get the same errant behavior.  I've also added in event listeners for a MouseListerner, a KeyListener and an ItemListener.  Still no event notification on this first item in the list.  Again, however, if I select one of the other items from the pop-up menu list and then select the first item, all is well.  Imagine selling that method of operation to a user....  It occurs to me that this must be a bug in the V6 JComboBox.  I wanted to post this here first, however, in order to determine if this is, in fact, a bug - in other words, am I the only one seeing this, or is this a more widespread issue?  Any assistance in making this determination is greatly appreciated.
    David Baker
    Edited by: Galstuk on Nov 27, 2007 12:21 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    here is the other file as well:
    Harold Timmis
    [email protected]
    Orlando,Fl
    *Kudos always welcome
    Attachments:
    VI2.vi ‏5 KB

  • .Mac aliases no longer appearing in Account pop-up menu

    Hi, a couple of days ago I noticed that my .Mac aliases are no longer listed in the Account pop-up menu of new messages. I thought it's a temporary .Mac problem, but this has continued.
    The account is a .Mac account (not POP nor IMAP), and I can go to Mail>Preferences>Accounts and click on the "Edit Email Aliases" button and can see that they are all still there on .Mac.
    How can I get them to show up again?
    MacBook Pro   Mac OS X (10.4.8)  

    Hi Hilal.
    I don’t know whether this would make a difference, but it may be worth a try:
    1. Quit Mail if it’s running.
    2. Make a backup copy of the ~/Library/Mail folder, just in case something goes wrong while trying to solve the problem. You can do this in the Finder by dragging the folder to the Desktop while holding the Option (Alt) key down, for example. This is where all your mail is stored.
    3. In the Finder, go to ~/Library/Preferences/. Locate com.apple.mail.plist and move it to the Desktop (to be deleted if this fixes the problem).
    4. Open Mail. You’ll have to set up your non-.Mac accounts from scratch all over again. If given the option to import existing mailboxes or something like that, don’t. Just enter the account information and Mail will automagically rediscover the data in ~/Library/Mail/ when done.
    You’ll also have to re-configure most of your settings in Mail > Preferences. For spam-related security reasons, the first thing you should do is go to Preferences > Viewing and disable Display remote images in HTML messages if it’s enabled.
    5. As a side effect of re-creating com.apple.mail.plist, Mail might rename Outbox (which is where messages waiting to be sent are stored) to Delivered. The name of that mailbox is actually a misnomer, as it would contain messages (if any) that couldn’t be delivered for some reason. You can delete that mailbox if you wish.
    Note: For those not familiarized with the ~/ notation, it refers to the user’s home folder. You can easily locate any of the folders referred to in this post by copying the folder path here, doing Go > Go to Folder in the Finder, and pasting the folder path there.

  • Image size pop up menu missing in mail window

    Tonight I was about to resize an attachment (a photo) in the Mail message window, but discovered that the image size pop up menu that used to appear at the bottom of the mail window is no longer there! I tried quitting Mail and launching it again, restarted the computer (a 2003 iMac G4 running Tiger), and repaired permissions. Any ideas on how I might get the image size pop up menu back again? Thanks.

    Seems there must be something messed up on the HD.
    Very Important, how much Free Space is on your Hard Drive first of all? Click on the Macintosh HD on the Desktop, then do a Get Info on it.
    Could be many things, we should start with this...
    "Try Disk Utility
    1. Insert the Mac OS X Install disc, then restart the computer while holding the C key.
    2. When your computer finishes starting up from the disc, choose Disk Utility from the Installer menu. (In Mac OS X 10.4 or later, you must select your language first.)
    *Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access Disk Utility.*
    3. Click the First Aid tab.
    4. Select your Mac OS X volume.
    5. Click Repair. Disk Utility checks and repairs the disk."
    http://docs.info.apple.com/article.html?artnum=106214
    Then try a Safe Boot, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, reboot when it completes.
    (Safe boot may stay on the gray radian for a long time, let it go, it's trying to repair the Hard Drive.)
    If perchance you can't find your install Disc, at least try it from the Safe Boot part onward.
    The important part is to Repair the Disk before Repairing Permissions.

  • How do I extract the list from a pop up menu back into Numbers?

    Hey guys
    I made a few very large lists in pop-up menus in Numbers, and I would like to extract those lists and put them
    in a seperate Numbers file.
    Is there a way that I can take the lists I made and sort of copy paste them /export them / extract them, so I don't
    have to manually copy them?
    Thanks in advance!
    Derk

    Hi Derk,
    Numbers doesn't seem to allow access to the values within a Pop-Up Menu, either through the native interface or through AppleScript.
    However, if you are using Numbers 3.2 and you have a long column formatted as Pop-Up Menu where you have "used" each the choices in the menu somewhere in the column, then you can collect a list of those values with the script below.
    Copy the script into AppleScript Editor.
    Select the cells in the body of your column formatted as Pop-Up Menu.
    Click the green triangle 'run' button.
    Click once in a destination cell in any Numbers document.
    Command-v or Edit > Paste & Match Style to paste the list of values.
    SG
    --places values from cells formatted as Pop-Up onto clipboard for pasting
    try
              tell application "Numbers"
                        set t to front document's active sheet's first table whose selection range's class is range
                        set {valuesList, valuesStr} to {{}, ""}
                        tell t's selection range to repeat with aCell in cells
                                  if aCell's formatted value is not in valuesList then
                                            copy aCell's formatted value to end of valuesList
                                            set valuesStr to valuesStr & aCell's formatted value & return
                                  end if
                        end repeat
                        set the clipboard to valuesStr
                        display notification "Click a cell and command-v to paste." with title "Numbers"
              end tell
    on error
              display alert "Did you select cells before running."
    end try
    --end of script

  • Using COUNTIF on time values in pop-up menu (employee schedule template)

    I have modified the Numbers employee schedule template to my liking and it works very well. I would like to add a column to the beginning which shows, at a glance, how many people I have scheduled for AM shifts and PM shifts on a given day. My AM shifts start at 9:00 AM and my PM shifts end at 6:30 or 8:30 PM.
    So I thought I could use COUNTIF, but after I set the array, I cannot get the condition right to return anything except "0". How do you make it detect the appropriate times? The times in each cell for In and Out times are selected using a pop-up menu, just like the template.
    Here is what I tried: =COUNTIF(E3:AE3,"9:00 AM")
    What should the condition be to return a proper count?

    ac,
    You shouldn't feel badly about having trouble with this template. It is a rather tricky one. The values in the Pop-Up menus are Date/Time values. That is to say, they have year, month, day, hour and minute components, even if only the hours and minutes are displayed. So if you only compare to the hours and minutes, you will never get a match.
    I don't know if you have experienced this yet, but when you changed the Pop-Up menu content, you probably entered the current year, month and day unknowingly and will have trouble doing math against the Pop-Up content that was originally in the template.
    My suggestion in your case would be to convert the time references to decimal hours before doing a comparison. For instance, if the time you wish to compare to is in cell C4, you could extract the decimal hours with =HOUR(C4)+MINUTE(C4)/60
    Remember that the hours will reflect a 24-hour day, so times in the afternoon will run from 12.0 to 23.99...
    Then after converting to decimal, instead of using "9:00 AM" for the COUNTIF criteria, use 9.
    There are probably ways to do this using the Duration format as well, but I prefer the decimal hours.
    Hope this helps.
    Jerry

  • I try to open Firefox. Get error message saying Firefox is already running and needs to close - another error message say Firefox can't open

    Turned on laptop (rebooted) after being away from it for a few hours. Went to open my home page. Error message popped up saying Firefox is already running and must be closed. I closed it and another error message popped up saying Firefox can't open - incomplete or missing files.
    I went into Processes to close Firefox. Selected 'end process' but nothing happened.
    Tried to use Internet Explorer but it just gets hung up. Cannot access anything.
    And, because I can't open Firefox, I can't go a refresh.
    Everything was working just fine a few hours ago.
    Any thoughts?

    What is the computer system and Firefox on the bad computer?
    Separate Issue;
    Your System Details on this computer shows;
    Multiple versions of your Adobe programs.
    Having more than one version of a program may cause issues.
    Go to '''adobe.com''' and download the full installers after removing
    all of the old programs.
    Start '''[https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode Firefox in Safe Mode]''' {web Link} by holding down the '''<Shift><br> ''(Mac Options)'' ''' key, and then starting Firefox. Is the problem still there?
    This is not a cure but will make it easier if Firefox locks up in Windows.
    '''https://support.mozilla.org/questions/997866''' {web link}

  • General Error or Crash using menu button on chapter playlists

    This is my first complex project in 2.0 - I needed to have approx 120 clips playable individually from a series of still menus. Given the 99 timeline limit, I created a number of timelines and placed batches of clips on them. I'm then using individual chapter playlists to reference each clip. The chapter playlist is linked from a menu button.
    When using the menu remote button when a chapter playlist is playing, I either get an 'abnormal condition' error, or occasionally, Encore crashes with no message at all. Tried this with no menus, timelines and playlists open but same errors.
    More detail:
    PAL 16:9 project
    28 timelines
    65 chapter playlists
    15 still menus
    approx 120 mpv clips and associated wavs (mpv encoded with cinemacraft encoder sp)
    Settings for one of the clips giving problems:
    Timeline - end action not set, menu remote - return to last menu, all ops permitted, no chapter end actions
    Chapter playlist - end action - return to last menu, override not set, menu remote - return to last menu, all ops permitted.
    I think I can stop the errors and crashes if I disable the menu remote button - but I don't really want to do this.
    Any ideas what's going on? Is it a bug(S)?
    Thanks,
    Paul.

    Paul.
    The trouble I had was the "Abnormal Condition" error when hitting the menu remote button in preview.
    There was no problem with Prev/Next buttons though.
    I tried burning a disc too, just to check if it would burn true & just played up in preview - but no dice. What happened was the player froze up solid after pressing the menu remote.
    I did create another project where the chapter playlists numbered around 28 from a single timeline, and this actually worked as it should do, so I suspect an issue in Encore's internal stacks where this is all addressed.
    I had to use a different application in the end.
    I believe the reason yours is still failing is simply because despite having 5 timelines, you are still well over the number of chapter playlists that seem to be available.
    It's a nasty bug - but apparently a fix is in the works. Hopefully we will see this as a maintenance release - we got these with both earlier versions (1.01 from 1.0, and 1.5.1 from 1.5) so I am hoping it will happen.
    There are a couple of issues I have noticed - although this is so far the only one I cannot work around in my projects.
    One thing has just occurred to me that might help you here.
    Instead iof using a chapter playlist to reference each clip, save these for multiple clips that need to be accessed, and from your chapter menu, just point directly to the clip in question.
    Set an end action for each clip to revert back to the menu that called it, and create just a single chapter playlist for a "Play All" situation.
    This will greatly reduce the number of chapter playlists you are running - and should do the job for you.

  • Need Help: JTable POP up menu in a CellEditor to display on a right click

    This was from a previous post:
    I am trying to make a POP menu in a JTextComponent that has a assigned JEditorPane for a HTMLDocument to make use of the HTMLEditorKit to allow modifying HTML by the POP up menu.
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.text.*;
    import javax.swing.table.*;
    import javax.swing.text.html.*;
    import javax.swing.undo.*;
    import javax.swing.border.*;
    import javax.swing.filechooser.*;
    public class SimpleTableDemo extends JFrame {
        public SimpleTableDemo() throws Exception {
            final JTable table = new JTable(new MyTableModel());
            table.setPreferredScrollableViewportSize(new Dimension(500, 70));
            TableColumn fileColumn = table.getColumnModel().getColumn(2);
            FileTableCellEditor editor = new FileTableCellEditor();
            fileColumn.setCellRenderer(editor);
            fileColumn.setCellEditor(editor);
            JScrollPane scrollPane = new JScrollPane(table);
            getContentPane().add(scrollPane, BorderLayout.CENTER);
            addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent e) {
                System.exit(0);
                table.setRowHeight(100);
            public static void main(String[] args) throws Exception {
                SimpleTableDemo frame = new SimpleTableDemo();
                frame.pack();
                frame.setVisible(true);
            class MyTableModel extends AbstractTableModel {
                String[] columnNames = {"First Name","Last Name","HTML File"};
                public Object[][] data;
                MyTableModel() throws Exception
                    data = createArray();
                private Object[][] createArray() throws Exception
                    Object[][] data = {{"One", "Andrews", createDoc("file1.html")}
                return data;
                private Document createDoc(String url) throws Exception
                    File file = new File(url);
                    URL baseURL = file.toURL();
                    InputStream in = baseURL.openStream();
                    InputStreamReader r = new InputStreamReader(filterTag(in));
                    HTMLEditorKit kit = new HTMLEditorKit();
                Document doc = kit.createDefaultDocument();
                kit.read(r,doc,0);
                return doc;
                } // workaround for HTMLEditorKit.Parser, cant deal with "content-encoding"
                private InputStream filterTag(InputStream in) throws IOException {
                    DataInputStream dins = new DataInputStream( in);
                    ByteArrayOutputStream bos = new ByteArrayOutputStream(10000);
                    DataInputStream din = new DataInputStream(new BufferedInputStream(in));
                    while (din.available() > 0) {
                    String line = din.readLine();
                    String lline = line.toLowerCase();
                    if (0 <= lline.indexOf("<meta ")) // skip meta tags
                    continue;
                    bos.write( line.getBytes());
                    din.close();
                    return new ByteArrayInputStream( bos.toByteArray());
                public int getColumnCount() {
                    return columnNames.length;
                public int getRowCount() {
                    return data.length;
                public String getColumnName(int col) {
                    return columnNames[col];
                public Object getValueAt(int row, int col) {
                    return data[row][col];
                public Class getColumnClass(int c) {
                    return getValueAt(0, c).getClass();
                public boolean isCellEditable(int row, int col) {
                if (col >< 1) {
                    return false;
                } else {
                    return true;
    public class FileTableCellEditor extends JScrollPane implements TableCellEditor , TableCellRenderer
        public JTextComponent jtext;
        JEditorPane editor;
        HTMLEditorKit kit = new HTMLEditorKit();
        HTMLDocument doc = new HTMLDocument();;
        private EventListenerList listenerList = new EventListenerList();
        private ChangeEvent event = new ChangeEvent(this);
        public FileTableCellEditor()
        editor = new JEditorPane();
        editor.setContentType("text/html");
        doc=new HTMLDocument();
        editor.addMouseListener(new MouseHandler());
        editor.setEditorKit(kit);
        editor.setDocument(doc);
        editor.setEditable(true);
        editor.setCaretColor(Color.RED);
        getViewport().setView(editor);
        setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
        setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
        public Component getTableCellRendererComponent(JTable table, Object value,
        boolean isSelected, boolean hasFocus, int row, int column)
            // System.out.println("has focus: "+hasFocus+", isSelected: "+isSelected);
            if (isSelected)
            table.editCellAt(row,column);
        table.editCellAt(row,column);
        return getTableCellEditorComponent(table,value,isSelected, row, column);
        public Component getTableCellEditorComponent(JTable table,
        Object value, boolean isSelected, int row, int column)
        editor.setDocument((Document)value);
        return this;
        public boolean isCellEditable(EventObject anEvent)
        { return true;
        public boolean shouldSelectCell(EventObject anEvent)
        { return true;
        public void cancelCellEditing()
        { fireEditingStopped();
        public boolean stopCellEditing()
        { return true;
        public Object getCellEditorValue()
        { return null;
        public void addCellEditorListener(CellEditorListener l)
        { listenerList.add(CellEditorListener.class, l);
        public void removeCellEditorListener(CellEditorListener l)
        { listenerList.remove(CellEditorListener.class, l);
        protected void fireEditingStopped()
        { Object[] listeners = listenerList.getListenerList();
        for (int i = listeners.length - 2; i >= 0; i -= 2)
        ((CellEditorListener)listeners[i+1]).
        editingStopped(event);
        protected void fireEditingCanceled()
        { Object[] listeners = listenerList.getListenerList();
        for (int i = listeners.length - 2; i >= 0; i -= 2)
        ((CellEditorListener)listeners[i+1]).
        editingCanceled(event);
            ///////////createPopupMenu///////////////
            protected JPopupMenu createPopupMenu()
            JPopupMenu popup =new JPopupMenu();
            popup.add(getTextComponent().getActionMap().get(HTMLEditorKit.cutAction)).setAccelerator(null);
            popup.add(getTextComponent().getActionMap().get(HTMLEditorKit.copyAction)).setAccelerator(null);
            popup.add(getTextComponent().getActionMap().get(HTMLEditorKit.pasteAction)).setAccelerator(null);
            popup.addSeparator();
            popup.add(getTextComponent().getActionMap().get("font-bold"));
            popup.add(getTextComponent().getActionMap().get("font-italic"));
            popup.add(getTextComponent().getActionMap().get("font-underline"));
            //popup.add(getTextComponent().getActionMap().get("break"));
            return popup;
        public JTextComponent getTextComponent()
             return jtext;
        protected class MouseHandler extends MouseAdapter{
           public void mouseReleased(MouseEvent me){
               if(me.getButton()==MouseEvent.BUTTON3){
               Point p=me.getPoint();
               createPopupMenu().show((Component)me.getSource(),p.x,p.y);
    }

    I got the pop up to work, I had to go back to and add a createActionTable editor that is a JEditorPane, vs the JTextComponent!
    Here is the latest version:
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import java.util.HashMap;
    import javax.swing.*;
    import javax.swing.undo.*;
    import javax.swing.event.*;
    import javax.swing.text.*;
    import javax.swing.table.*;
    import javax.swing.text.html.*;
    import javax.swing.undo.*;
    import javax.swing.border.*;
    import javax.swing.filechooser.*;
    public class SimpleTableDemo extends JFrame {
        public SimpleTableDemo() throws Exception {
            final JTable table = new JTable(new MyTableModel());
            table.setPreferredScrollableViewportSize(new Dimension(500, 70));
            TableColumn fileColumn = table.getColumnModel().getColumn(2);
            FileTableCellEditor editor = new FileTableCellEditor();
            fileColumn.setCellRenderer(editor);
            fileColumn.setCellEditor(editor);
            JScrollPane scrollPane = new JScrollPane(table);
            getContentPane().add(scrollPane, BorderLayout.CENTER);
            addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent e) {
                System.exit(0);
                table.setRowHeight(100);
            public static void main(String[] args) throws Exception {
                SimpleTableDemo frame = new SimpleTableDemo();
                frame.pack();
                frame.setVisible(true);
            class MyTableModel extends AbstractTableModel {
                String[] columnNames = {"First Name","Last Name","HTML File"};
                public Object[][] data;
                MyTableModel() throws Exception
                    data = createArray();
                private Object[][] createArray() throws Exception
                    Object[][] data = {{"One", "Andrews", createDoc("file1.html")}
                return data;
                private Document createDoc(String url) throws Exception
                    File file = new File(url);
                    URL baseURL = file.toURL();
                    InputStream in = baseURL.openStream();
                    InputStreamReader r = new InputStreamReader(filterTag(in));
                    HTMLEditorKit kit = new HTMLEditorKit();
                Document doc = kit.createDefaultDocument();
                kit.read(r,doc,0);
                return doc;
                } // workaround for HTMLEditorKit.Parser, cant deal with "content-encoding"
                private InputStream filterTag(InputStream in) throws IOException {
                    DataInputStream dins = new DataInputStream( in);
                    ByteArrayOutputStream bos = new ByteArrayOutputStream(10000);
                    DataInputStream din = new DataInputStream(new BufferedInputStream(in));
                    while (din.available() > 0) {
                    String line = din.readLine();
                    String lline = line.toLowerCase();
                    if (0 <= lline.indexOf("<meta ")) // skip meta tags
                    continue;
                    bos.write( line.getBytes());
                    din.close();
                    return new ByteArrayInputStream( bos.toByteArray());
                public int getColumnCount() {
                    return columnNames.length;
                public int getRowCount() {
                    return data.length;
                public String getColumnName(int col) {
                    return columnNames[col];
                public Object getValueAt(int row, int col) {
                    return data[row][col];
                public Class getColumnClass(int c) {
                    return getValueAt(0, c).getClass();
                public boolean isCellEditable(int row, int col) {
                if (col < 1) {
                    return false;
                } else {
                    return true;
    public class FileTableCellEditor extends JScrollPane implements TableCellEditor , TableCellRenderer
        JEditorPane editor = new JEditorPane();
        HTMLEditorKit kit = new HTMLEditorKit();
        HTMLDocument doc = new HTMLDocument();;
        private EventListenerList listenerList = new EventListenerList();
        private ChangeEvent event = new ChangeEvent(this);
        HashMap<Object, Action> actions;
        public FileTableCellEditor()
        getContentPane();
        editor.setContentType("text/html");
        doc=new HTMLDocument();
        editor.addMouseListener(new MouseHandler());
        editor.setEditorKit(kit);
        editor.setDocument(doc);
        editor.setEditable(true);
        editor.setCaretColor(Color.RED);
        getViewport().setView(editor);
        createActionTable(editor);
        makeActionsPretty();
        setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
        setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
        public void makeActionsPretty(){
             Action a;
                      a=editor.getActionMap().get(HTMLEditorKit.cutAction);
                      a.putValue(Action.SHORT_DESCRIPTION,"Cut");
                      a.putValue(Action.ACCELERATOR_KEY,KeyStroke.getKeyStroke('X',Event.CTRL_MASK));
                      a=editor.getActionMap().get(HTMLEditorKit.copyAction);
                      a.putValue(Action.NAME,"Copy");
                      a.putValue(Action.SHORT_DESCRIPTION,"Copy");
                      a.putValue(Action.ACCELERATOR_KEY,KeyStroke.getKeyStroke('C',Event.CTRL_MASK));
                      a=editor.getActionMap().get(HTMLEditorKit.pasteAction);
                      a.putValue(Action.NAME,"Paste");
                      a.putValue(Action.SHORT_DESCRIPTION,"Paste");
                      a.putValue(Action.ACCELERATOR_KEY,KeyStroke.getKeyStroke('V',Event.CTRL_MASK));
        public Component getTableCellRendererComponent(JTable table, Object value,
        boolean isSelected, boolean hasFocus, int row, int column)
            if (isSelected)
            table.editCellAt(row,column);
        table.editCellAt(row,column);
        return getTableCellEditorComponent(table,value,isSelected, row, column);
        public Component getTableCellEditorComponent(JTable table,
        Object value, boolean isSelected, int row, int column)
        editor.setDocument((Document)value);
        return this;
        public boolean isCellEditable(EventObject anEvent)
        { return true;
        public boolean shouldSelectCell(EventObject anEvent)
        { return true;
        public void cancelCellEditing()
        { fireEditingStopped();
        public boolean stopCellEditing()
        { return true;
        public Object getCellEditorValue()
        { return null;
        public void addCellEditorListener(CellEditorListener l)
        { listenerList.add(CellEditorListener.class, l);
        public void removeCellEditorListener(CellEditorListener l)
        { listenerList.remove(CellEditorListener.class, l);
        protected void fireEditingStopped()
        { Object[] listeners = listenerList.getListenerList();
        for (int i = listeners.length - 2; i >= 0; i -= 2)
        ((CellEditorListener)listeners[i+1]).
        editingStopped(event);
        protected JPopupMenu createPopupMenu()
            JPopupMenu popup =new JPopupMenu();
            popup.add(getActionByName(DefaultEditorKit.cutAction));
            return popup;
        protected class MouseHandler extends MouseAdapter{
           public void mouseReleased(MouseEvent me){
               if(me.getButton()==MouseEvent.BUTTON3){
               Point p=me.getPoint();
               createPopupMenu().show((Component)me.getSource(),p.x,p.y);
        private void createActionTable(JTextComponent textComponent) {
            actions = new HashMap<Object, Action>();
            Action[] actionsArray = textComponent.getActions();
            for (int i = 0; i < actionsArray.length; i++) {
                Action a = actionsArray;
    actions.put(a.getValue(Action.NAME), a);
    private Action getActionByName(String name) {
    return actions.get(name);

  • Just installed itunes but when i try to open it this error message pops up: "apple application support required." I've tried uninstalling and reinstalling but nothing works

    Just installed itunes but when i try to open it this error message pops up: "apple application required" then it suggests uninstalling and reinstalling which i've done a few times but nothing works

    When you say you have tried everything, it would help if you told us what you have tried to avoid duplication.
    When you installed iTunes did you get any error messages?
    Anyway, on the face of it it may be worth trying a separate install of Apple application support.
    Uninstall iTunes again. Now open Apple Software update, assuming it is working.
    It should offer to download iTunes. Don't do it yet, go to the Tools menu and select Download only.
    Then download iTunes. Then go to the tools menu again and select Open download folder and you should see a collection of six files.
    Before going on, can you get to this stage OK?
    One further thing I would like you to check, are you ahving any problems with Windows updates? Could you check in Windows Update to see if there are any failures.

  • When I try entering a new event in iCal on my MacBook Air, I get an error message popping up on my screen that says: The request for account "iCloud" failed.  The server responded with "502" to operation CalDAVSetPropertyQueueableOperation. Help!!??

    When I try entering a new event in iCal on my MacBook Air, I get an error message popping up on my screen that says:
    The server responded with “502”
    The request for account “iCloud” failed. 
    The server responded with “502” to operation CalDAVSetPropertyQueueableOperation.
    The request for account “iCloud” failed.
    I am then given the option of staying Online or going Offline.
    Can anyone help me?
    thanks

    Hello b.krushel,
    Thank you for using Apple Support Communities
    Any number of things could cause this issue, so I would recommend this article named iCloud: Troubleshooting iCloud Calendar found here http://support.apple.com/kb/TS3999.
    These sections in particular:
    General Troubleshooting
    Make sure there are no current issues listed on the System Status that affect iCloud Calendar. The System Status is located on the iCloud Support webpage.
    Make sure you have fully enabled iCloud Calendar for the client you are using (for more setup and troubleshooting information on iOS, OS X, Windows and iCloud.com, see the additional details below).
    Check to see if the issue you are seeing is covered in iCloud Help. To search iCloud Help, visit help.apple.com/icloud.
    Check your settings and preferences as something may not be set up correctly. For example, having incorrect date and time settings can cause issues which are easily resolved by entering the appropriate settings.
    Troubleshooting Calendar on OS X Mountain Lion (iCal on OS X Lion)Note: For instructions on setting up iCloud Calendar with Calendar or iCal on your Mac, see iCloud Setup.If you are having trouble with Calendar or iCal on a Mac and you are using iCloud Calendar, try each of these steps, testing after each to see if the issue is resolved:
    Make sure you are using OS X Lion v10.7.2 or later. Click here for help verifying the version of OS X you are using.
    Make sure your computer is online. Attempt to view www.apple.com and iCloud.com. If you can't connect to the Internet, your iCloud calendars and events will not update in iCal. Click here for more information about troubleshooting your Internet connection.
    Verify that your iCloud member name is entered into the iCloud Preference pane in System Preferences. See iCloud Setup for more information about setting up iCloud on a Mac.
    Make sure you enter and update calendar information in the iCloud section of Calendar or iCal. Only calendars and events in the iCloud section of the Calendar or iCal Calendar list will be pushed to iCloud. Both Calendar and iCal for the Mac support the display of and interaction with multiple accounts and datastores, for example, iCloud, On My Mac, Exchange, Google, and so on. This makes it easy to create or modify events or calendars in a section of  Calendar or iCal that may not be updating iCloud. Learn more about moving local calendars to iCloud.
    In some cases, you may find that you have data duplicated in both the local On My Mac and the iCloud sections of Calendar or iCal. Learn more about resolving this issue.
    You can make the iCloud calendar your default calendar for all new events. In Calendar on OS X Mountain Lion, choose Calendar > Preferences > General, or in OS X Lion, choose iCal > Preferences > Generaland under the Default Calendar heading, select one of the Calendars under the iCloud heading. Close the Preferences window to save this change.
    If recent changes simply don't appear, try forcing Calendar or iCal to refresh by selecting Refresh All from theCalendar menu.
    Make sure your account was successfully created in Calendar on your Mac (or iCal). After upgrading to iCloud Calendar, you may need to quit and reopen Calendar (or iCal). To confirm your account is configured correctly in iCal:
    Open Calendar (or iCal).
    Open Calendar (or iCal) Preferences.
    Click Accounts. You should see an account with your iCloud member name entered.
    Turn iCloud Calendars off and back on
    Quit Calendar (or iCal).
    Choose Apple () menu > System Preferences > iCloud.
    Remove the checkmark in the checkbox next to Calendars.
    Close System Preferences and wait about a minute.
    Open System Preferences and choose iCloud.
    Replace the checkmark next to Calendars.
    Close System Preferences.
    Open Calendar (or iCal) and test to see if the issue has been resolved.
    Restart your computer. This may sound simple, but it does reinitialize your network and application settings and can frequently resolve issues.
    Take care,
    Sterling

Maybe you are looking for

  • Adding 2nd iPhone To AT&T Account?

    Quick question, folks. I currently have an iPhone 3G on my AT&T account, as well as an additional Nokia phone line on the plan, which charges me an additional $10 a month. My Father decided he would like to get an iPhone 3G, but would like to add it

  • About for update clause

    hi, i want to lock some rows that i've selected in a program. so, i use a for update clause. Here is my query: SELECT * FROM (      SELECT name, age, classe, average      FROM student      WHERE average >= '15'      AND warning is NULL      AND statu

  • How can I increase the Menu / tool bar in Photoshop CS 6 standard on Windows 8.1?

    Greetings, The UI is set to Large.  I changed the display settings and it did not help. I'm using a new Lenovo laptop.  I have several licenses for my company and it installs fine on windows 7. Any help would be great.. Thanks, Kacey [email protected

  • Is there any way to find out the dependency information for column of view?

    Does Oracle provide some view / table / pl/sql pkgs to find out the dependency information for column of view ? For example, there are two table mytable1 (col1 varchar2(10), col2 date) & mytable2 (col1 varchar2(10), qty int), and there is one view my

  • I rented a movie on my Mac, it won't transfer to Apple TV.

    Do I have to be on the same network to transfer?