Help with pop-up menu --- please!

I want to see if I can get this simple code working so that I can integrate the ideas into a larger application. But, I'm getting errors on this one! What am I missing or forgetting?
public class example implements MouseInputListener,MouseMotionListener{
     JPopupMenu menu = new JPopupMenu();
     public static void main (String args[]) {
          Frame f = new Frame();
          {Window w = new Window(f);
          w.setSize(200,100);
          w.setVisible(true);
          w.setLocation(300,300);
          //New Red Window
          {Window w= new warningwindow (f);
          w.setSize(200,100);     //setSize is in a superclass
          w.setVisible(true);
          w.setLocation(370,370);}
          // Create and add a menu item
     JMenuItem item = new JMenuItem("Hi Kimberly!");
     addMouseListener(this); //ERROR WITH THIS LINE
     menu.add(item); //ERROR WITH THIS LINE ALSO
     // Set the component to show the popup menu
     public void mouseClicked (MouseEvent e) {
          if(e.isPopupTrigger()){
               menu.show(e.getComponent(),e.getX(), e.getY());
     public void mouseReleased (MouseEvent e){
          if (e.isPopupTrigger()){
               menu.show(e.getComponent(),e.getX(),e.getY());
     public void mouseExited (MouseEvent e){
     public void mouseMoved (MouseEvent e){
     public void mouseDragged (MouseEvent e){
     public void mousePressed (MouseEvent e){
     public void mouseEntered (MouseEvent e){
}

You're forgetting that we can't see your computer from here. Tell us what errors you are getting.

Similar Messages

  • Need help with pop-up menu please!

    So I have an older version of Dreamweaver.
    I want to apply a drop-down menu or pop-up menu whatever to
    words, but so far I don't think I can do that.
    I've decided to apply it to a picture instead, and I've done
    this successfuly before.
    I select the picture, then go to behaviors and select "show
    pop-up menu", fill in the info and say OK, but I then get this
    message that goes something like "while applying behaviors action
    javascript failed" and "ReferenceError:imgName isNot defined" or
    whatever and it won't let me add it.
    I've restarted the program and even my computer but it won't
    go away.
    Does anyone know how to fix this?
    -anna

    > So I have an older version of Dreamweaver.
    DW4?
    The pop-up menus are very troublesome. Nobody here would
    recommend that you
    use them.
    > Does anyone know how to fix this?
    What is your operating system?
    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
    ==================
    "anzya91" <[email protected]> wrote in
    message
    news:eibt0r$esr$[email protected]..
    > So I have an older version of Dreamweaver.
    > I want to apply a drop-down menu or pop-up menu whatever
    to words, but so
    > far
    > I don't think I can do that.
    > I've decided to apply it to a picture instead, and I've
    done this
    > successfuly
    > before.
    > I select the picture, then go to behaviors and select
    "show pop-up menu",
    > fill
    > in the info and say OK, but I then get this message that
    goes something
    > like
    > "while applying behaviors action javascript failed" and
    > "ReferenceError:imgName
    > isNot defined" or whatever and it won't let me add it.
    > I've restarted the program and even my computer but it
    won't go away.
    > Does anyone know how to fix this?
    >
    > -anna
    >

  • Need help with pop-up menu and applied Rules

    I'm working on a spreadsheet that calculates my profit and losses. I drive a big rig so it needs to keep track of a lot of variables so I know if I'm going to make money on a run or lose money.
    I get fuel discounts of various amounts depending on which vendor I fuel at.
    I went to a section of the sheet and did a pop-up menu that contains the vendor names.
    In the trip section I have cost of fuel per gallon, gallons purchased, total fuel cost, cost minus fuel surcharge.
    What I would like to do is apply a rule to cost per gallon box (H7) that takes a variable from the pop-up menu (B40).
    So if H7 has $2.58 entered as a cost and B40 has pilot selected then $0.050 will automatically be deducted from the $2.58. This way I will have a history of where I fuel, the deduction is made automatically, and I have a history of fuel prices in a certain region.
    If anyone looks at this and sees a simpler way of figuring this calculation please make the suggestion. I want to keep this sheet as small and hassle free as possible.
    I have 3 fuel stops per trip with totals that are connected to other areas. Once I get all of this done I will be adding a chart for easy comparison and long range simple tracking to see where improvements can be made and costs are going.
    Thanks in advance all help will be appreciated.
    Message was edited by: Hwoodwriter for clarification.

    The IF Lookup table worked. Did a little modification by placing the table in another part of the chart then hiding that part.
    I tried doing the discount as a negative but got a negative total which had a negative affect on my total trip income.
    Here is how it works in it's final version.
    Gallons on board minus gallons required for trip.
    Cost per gallon (retail) multiplied by gallons purchased.
    Fuel cost equals (Gallons purchased multiplied by Retail gallon price) minus ("IfLookup" multiplied by Gallons purchased)
    Fuel Cost Minus Fuel Surcharge (the actual price I pay, which includes all my savings) equals (Retail Gallon Cost minus Fuel Surcharge minus "IfLookup") multiplied by Gallons Purchased.
    Some of my trips take up to 3 fuel stops. So this helps me keep track of each fuel stop and all savings per trip.
    I now have where I fueled, the retail price, with discount and surcharge applied. A few keystrokes and I know if a trip is going to be profitable or a loss for me.
    Thank you for the help. I now have what I need at my fingertips to make my job more effective.
    Thanks again.

  • I need help with the navigation menu please?

    I have been working my way through your six part printed instructions and I am styling the header and navigation menu.  The bullet points disappeared which was correct and the tabs moved to the right, as they should, but one tab sits underneath another tab and all tabs are covered up by my main heading.  This is dreamweaver CS6.
    It looks a bit of a mess!

    I have moved this to the main Dreamweaver forum, as the other forum is intended to deal with the Getting Started video tutorial.
    The best way to get help with layout problems is to upload the files to a website and post the URL in the forum. Someone can then look at the code, and identify the problem. Judging from your description, it sounds as though the Document window is narrow, which would result in the final menu tab dropping down to the next row. Try turning on Live view or previewing the page in a browser. Design view gives only an approximate idea of the final layout. Live view renders the page as it should look in a browser.

  • Help with pop-up menu

    Im haveing a hard time figuring out how to make a pop-up mene i created work correctly. I what to have a pop-up menu that will let you select a type of item, and return the items associate cost in the adjacent cell.
    Exaple:
    select option 1-3 in cell "A" and return values x,y & z in cell "B".
    I figured out how to create the pop-up in cell "a" but cant seam to fugure out how to give each of the options a seperate value that appears in "b".

    Assuming the pop up is in B1:
    you could enter the following formula in C1:
    =IF(B1=1, "A", IF(B1=2, "B", IF(B1=3, "C", "")))
    This will result in the following:
    B1 = 1,  C1 will return "A"
    B1 = 2,  C1 will return "B"
    B1 = 3,  C1 will return "C"
    This method is ok for a small translation set.  Much larger and it is hard to change and update.  So the next method is to recognize if there is a pattern.  If there is no pattern then you can make a translation table:
    In this case you look up the value "3" in the Data table (column 1) and return the corresponding value from a different cell in the same row (column 2):
    B3=VLOOKUP(A1, Data :: A:B, 2, 0)
    I hope this helps,
    Wayne

  • "Open with" pop-up menu application list editing

    I have installed Adobe Photoshop CS2 on my iBook G4. When opening .jpg or other file with "Open with" pop-up menu there is alot of applications which gives only a long list for me. How to edit this list.

    hi vienspatsmajas,
    You can try using Zingg! to configure the "open with" menu
    http://www.versiontracker.com/dyn/moreinfo/macosx/12965&vid=130824
    Lori

  • Help with pop art please!

    Hello all,
    Im new to this forum and also to Photoshop Elements so i hope i am posting in the correct place and section.
    I have created a lovely pop art image and know that it is possible to split the same image into four sections on the same page but with different colours but cannot for the life of me figure out how to do this!!
    Is it possibly to do with grids? I really have no idea and would love some help with this.
    Many thanks
    Daniel

    Hi Terri,
    Unfortunately the info appears to be with a diff version.
    I am using Elements 8.
    I should also state that i am working from an already created pop art image and trying to split it in to four.
    Any furter suggestions?
    Thanks
    Daniel

  • Need help with pop up menus...

    Hi guys, hope u can help me with this. Im working on a flash
    website. I have to include a pop up menu which I have managed to
    create no problem. However, when I try to make the buttons inside
    the pop up to change to another scene when clicked I cant get them
    to work. This is the code I've used:
    on (release) {
    _root.gotoAndStop("Student_area","tests");
    I have defined the action to go to the frame labeled "tests"
    in the "Student_area" scene as I have been told in a tutorial I
    have. However when I test it and click on it nothing happens. I
    have tried many variations such as simply telling it to take me to
    the students scene like I would do with a normal button but still
    nothing happens.
    What am I doing wrong?
    Hope someone can help me, gotta submit this soon.
    Thanks in advance.

    bump...
    Anyone?? Please.

  • Help with spry tabbed menu bar

    Hi.
    I need help with the spry tabbed menu panel (horizontal) It
    works fine in dreamweaver ( pressing f12 ) but when i goto my
    website www.so-nouveau.com it puts it all over and not in boxes
    either just the writing.
    I ahve double checked all uploading is correct and files are
    located but it wont work.
    Here is what i did >
    new> html> 1 column elastic,centered. i have not
    changed any other settings at all. Do i need to change the doc type
    or css layout in the drop down menus before starting (doc
    type=xhtnl 1.0 transitional and layout css=add to head)
    I am still on cs3 , does this matter ? or is 4 easier ?
    any help out there guys is much appreciated but please bear
    in mind that i am not a web designer or pc expert at all , this is
    just me building my own site , until nowit has been an enjoyable
    experience but grrrrrr when it dont work
    Thanks
    Jay

    so-nouveau wrote:
    > Hi.
    > I need help with the spry tabbed menu panel (horizontal)
    It works fine in
    > dreamweaver ( pressing f12 ) but when i goto my website
    www.so-nouveau.com it
    > puts it all over and not in boxes either just the
    writing.
    Please post links directly to the page having an issue. I saw
    no tabs on the home page, but I noticed that there is a link on the
    bottom of the page to this page that has a Spry tab on it:
    http://www.so-nouveau.com/test%208.html
    > I ahve double checked all uploading is correct and files
    are located but it
    > wont work.
    That page refers to a Spry JavaScript file and a Spry CSS
    file, which should be at the following locations but are not
    present:
    http://www.so-nouveau.com/SpryAssets/SpryTabbedPanels.js
    http://www.so-nouveau.com/SpryAssets/SpryTabbedPanels.css
    Make sure you upload the SpryAssests folder and see where
    you're at after that.
    Danilo Celic
    |
    http://blog.extensioneering.com/
    | WebAssist Extensioneer
    | Adobe Community Expert

  • Show/Hide layer with Pop-up menu

    I love the fact that we are talking about websites here and this one WORKS LIKE ****...and that's diarrhea. I have been trying to just get on this ******* forum to ask this question for 2 days.
    Anyway, I typed this out earlier but it wasn't accepted, I don't know why. Let's see if this one works.
    I am not a code monkey, not even really a web person. I am doing this for a friend, so I can't understand really complicated answers. BUT, here's my problem: I want to make two layers disappear in my index page because they interfere with the pop-up menu of another layer. This, I can do. BUT, I want these layers to reappear when someone moves off the POP-UP, not the link. When I use the "behaviors" that come with Dreamweaver, they all relate only to the link, not the Pop-up menu, so as soon as a user moves down the pop-up menu and off the link, the two layers reappear.
    Here is what I'm talking about, if that doesn't make too much sense:
    http://www.animalcrackerspetsupply.com/Index1.html
    Thank you for reading this and, please, Adobe people, can you make it simpler to get into the forum?
    Kelly

    I didn't realise that f*r*i*g*g*e*n was a naughty word here in the USA.
    The link that I am referring to is found under the "CATS" heading.....

  • Problem with pop up menu created in fireworks

    I have created a banner with buttons and added a pop up menu to them.
    They work perfectly with-in Fireworks.
    I then export page to dreamweaver and both banner and buttons display properly but I cannot get pop up menu to show at all.
    I want to choose each menu and make the links with-in dreamweaver but cannot get pop up top show.
    I am using CS5 and would appreciate your help.
    AlSO I AM STILL LEARNING SO IF YOU COULD KEEP IT AS SIMPLE AS POSSIBLE I WOULD APPRECIATE IT. 

    HELLO AND THANK YOU FOR YOUR REPLY. I HAVE CREATED A QUICK BANNER WHICH IS SIMILAR TO THE ONE I WANT TO CREATE. THE LIST OF BUTTON ARE  PLACED INTO MY BANNER AND I HAVE ADDED POP UP MENUS TO ALL WITH 3 CELLS DEEP DROPPING DOWNWARDS. WHEN I VIEW THESE IN PREVIEW IN A WEB BROWSER FROM FIREWORKS THEY WORK PERFECTLY. THE PROBLEM IS THAT I DON'T SEEM TO BE ABLE TO MOVE THIS PAGE TO DREAM WEAVER AND HAVE IT DISPLAY THE POP UP MENUS. THEY WILL SHOW AS AN IMAGE AS IT IS SEEN HERE BUT WILL NOT DROP DOWN IN PREVIEW BROWSER IN DREAM WEAVER. I WANT TO BE ABLE TO SELECT THE INDIVIDUAL LISTS IN THE DROP DOWN MENU AND CREATE LINKS TO VARIOUS PAGES WITH-IN MY SITE IN DREAM WEAVER. IT MAY BE THE CASE THAT I AM NOT EXPORTING IT PROPERLY OR SAVING  IT CORRECTLY.

  • Help! Pop-up menu problem

    I made a pop-up menu in a trial version of Fireworks 8.
    Everything works great within Fireworks, but when I try to insert
    it in Dreamweaver 4 (using the Insert Fireworks html button) it
    tells me that I need to insert an Fireworks html that was exported
    from Fireworks. The pop-up menu I made was exported as an html from
    Fireworks. Help!

    I don't think you are going to have much success trying to
    marry DW4 with
    anything contemporary. It's methods and structure are so
    antique, you know?
    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
    ==================
    "Erin88" <[email protected]> wrote in
    message
    news:er308c$391$[email protected]..
    >I made a pop-up menu in a trial version of Fireworks 8.
    Everything works
    >great
    > within Fireworks, but when I try to insert it in
    Dreamweaver 4 (using the
    > Insert Fireworks html button) it tells me that I need to
    insert an
    > Fireworks
    > html that was exported from Fireworks. The pop-up menu I
    made was exported
    > as
    > an html from Fireworks. Help!
    >

  • 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);

  • Rollovers with Pop up Menu

    The last time I tried to do rollovers with a pop up menu in
    Dreamweaver 8. It wouldn't work. So I'm searching for another way
    to do it.
    I created navigation using Fireworks - follow link below to
    example. But when I mouse over the rollover that has a pop up menu
    attached to it (First link on the left) the rollover images
    disappear. Also the drop down menu tends to hang down longer than I
    would like.
    Can my problems be fixed? Is Fireworks the right tool for
    this task?
    I had down loaded a trial of the latest version of
    Dreamweaver a few months ago and it seemed that this feature had
    been deprecated, but there was some sort of plug-in. I'm far from a
    casual user, but it was beyond me for the weekend I tried to use
    it. Also, this is a bad time for me to invest in new software or
    upgrades.
    Any assistance would be greatly appreciated.
    Example of rollover and
    pop up menu problem

    Don't use Fireworks to make HTML,
    especially interactive HTML. Fireworks is a great tool for
    making Web graphics, but it is
    NOT
    good for making HTML. Don't go there. You won't be happy.
    Read this:
    The
    Sordid Tale of mm_menu and fw_menu.js and then save yourself
    loads of frustration and go buy yourself a professional menu.
    What's your billing rate? At $20/hr a $100 professional menu that
    works, cross-browser, beautifully, is going to save you more
    than 5 hours of hassle trying to get this stuff in Fireworks to
    halfway...kinda...function...almost.
    I don't use these kind of menus, but I've seen this question
    asked often enough to know that one recommendation is the code from
    Project
    7.

  • Need some help with the colour profile please. Urgent! Thanks

    Dear all, I need help with the colour profile of my photoshop CS6. 
    I've taken a photo with my Canon DSLR. When I opened the raw with ACDSee, the colour looks perfectly ok.
    So I go ahead and open in photoshop. I did nothing to the photo. It still looks ok
    Then I'm prompt the Embedded Profile Mismatch error. I go ahead and choose Discard the embedded profile option
    And the colour started to get messed up.
    And the output is a total diasater
    Put the above photo side by side with the raw, the red has became crimson!!
    So I tried the other option, Use the embedded profile
    The whole picture turns yellowish in Photoshop's interface
    And the output is just the same as the third option.
    Could someone please guide me how to fix this? Thank you.

    I'm prompt the Embedded Profile Mismatch error. I go ahead and choose Discard the embedded profile option
    always use the embedded profile when opening tagged images in Photoshop - at that point Photoshop will convert the source colors over to your monitor space correctly
    if your colors are wrong at that point either your monitor profile is off, or your source colors are not what you think they are - if other apps are displaying correctly you most likely have either a defective monitor profile or source profile issues
    windows calibrate link:
    http://windows.microsoft.com/en-US/windows7/Calibrate-your-display
    for Photoshop to work properly, i recall you want to have "use my settings for this device" checked in Color Management> Device tab
    you may want to download the PDI reference image to check your monitor and print workflows
    and complete five easy steps to profile enlightenment in Photoshop
    with your settings, monitor profile and source profiles sorted out it should be pretty easy to pinpoint the problem...

Maybe you are looking for

  • Mail a HTML atachment from ABAP report

    Hi Experts, I want to e-mail an HTML file( containing icons and gif images) as an attachment from an ABAP report. Could u provide assisteence on how this is to be done? Kindy help.. Regards.

  • How do I get help renaming my community id?

    I didn't pay attention when creating the forum account, and got stuck with this auto generated name.  How do I change it?  I am fine deleting it. Thanks, Rick

  • Upgrading from Portal 6.x to 6.1

    Hello, We are upgrading our portal form 6.0 SP1 to 6.1 MP1 (of course we started this before 6.5 was released). One of the major differences is the search - at least architecture. But for the end user - will anything be noticed. For those who did upg

  • Cross-platform connection

    IS it possible to have a Workshop instance that is installed on Windows talking to a remote WLS on UNIX? If so, how should the server properties be set? Thanks Niz

  • Ipod nano 7 gen wont play sound but works perfect

    i just got the ipod 2 months ago and one day it just stop playing sound but everything works on it... ive tried restoring it but it still want play music. please help