How can i create an event from a cell of JTable ?

Hi , I am having a JTable which has two types of render : checkboxCellRender and DefaultTableCellRenderer
i want to generate an event by clicking the checkbox which will do color changes for other cells . How can i do that ? Can i pass the events ?
code snippet :
class checkboxCellRenderExt extends checkboxCellRender
          public checkboxCellRenderExt(){}
          public Component getTableCellRendererComponent(JTable table, Object value,
                    boolean isSelected, boolean hasFocus,
                    int row, int column)
JCheckBox c=(JCheckBox)super.getTableCellRendererComponent( table,value,isSelected,hasFocus,row, column);
JTableModel md = (JTableModel)m_TablePan.getTable().getModel();
Vector currentRow = md.getRow(row);
if(isSelected)
boolean m_bavail = ((Boolean)currentRow.get(COLUMN_TCM_STATUS)).booleanValue();
if(!m_bavail)
     c.setForeground(Color.BLACK);
     c.setBackground(Color.WHITE);
else
     c.setForeground(table.getSelectionForeground());
     c.setBackground(table.getSelectionBackground());
else
setForeground(table.getForeground());
setBackground(table.getBackground());
return this;
class CustomcellRenderer extends DefaultTableCellRenderer
     public CustomcellRenderer()
     public Component getTableCellRendererComponent(JTable table, Object value,
                              boolean isSelected, boolean hasFocus,
                              int row, int column)
          checkboxCellRender chkbox =null;
          JLabel lb;
          Component c = super.getTableCellRendererComponent(table,value,isSelected,hasFocus,row, column);
          if (value == null)
     return c;
          if (value instanceof String)
               String s = (String) value;
               lb = (JLabel)c;
               lb.setBorder (noFocusBorder);
               lb.setText(s);
     JTableModel md = (JTableModel)m_TablePan.getTable().getModel();
     Vector currentRow = md.getRow(row);
          this.setHorizontalAlignment(JCheckBox.CENTER);
if(isSelected)
               boolean m_bavail = ((Boolean)currentRow.get(COLUMN_TCM_STATUS)).booleanValue();
               if(!m_bavail)
                    c.setForeground(Color.BLACK);
                    c.setBackground(Color.WHITE);
               else
               c.setForeground(table.getSelectionForeground());
               c.setBackground(table.getSelectionBackground());
else
               setForeground(table.getForeground());
               setBackground(table.getBackground());
return this;
}

Don't forget to use the Code Formatting Tags so the posted code retains its original formatting. That is done by selecting the code and then clicking on the "Code" button above the question input area.
Add a TableModelListener to the TableModel. An event is fired when the contents of the cell are changed.

Similar Messages

  • How can I create a link from a CHM file to a webhelp file?

    How can I create a link from a CHM file to a webhelp file?
    The CHM output (accreditation.chm) is stored in a parent directory, and the webhelp output (index.htm) is stored in a child directory.

    Open the usual Link dialog and enter the relative path from where the CHM will be installed to where the webhelp will be installed.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • How can I get the events from a java program?

    I want to make a monitor to watch a java program.How can I get the events from the GUI of this program some as mouse cliking, keyinput. So I can watch these in my monitor.
    Thanks

    Hi,
    To put a monitor to the events occuring in the GHUI u need to register required components with the appropriate EventListeners.
    Liek if u want to get notified when a mouse is clicked, then u need to add The MouseListener to the component which u want to be monitored.
    Say
    myFrame which is the JFrame object which shuld be monitored for the events.
    Then in ur program u have to add following code
    myFrame.addMouseListener( someObectReference );
    Here the someObjectReference should be an instance to a concrete class ..i.e. U write a class like the following
    public class MyMouseListener implements MouseListener {
    // override the followig methods
    public void mouseClicked(MouseEvent me){ sop("MOUSE CLICKED ON THE FRAME");}
    public void mousePressed(MouseEvent me){}
    public void mouseReleased(MouseEvent me){}
    If u dont want to use another class for listening to the events. Then u can make teh current class monitor the events. To do so ur class should implement the appropriate listener and should override the required methods.
    and u should say myFrame.addMouseListenet( this );
    thats it

  • How can i create proxy service from another proxy on different domain

    i have a demo webservice. it has many operations on proxy service's message flow. How can i create proxy service from demo's wsdl on different domain
    Edited by: fresh man on Jul 1, 2012 11:17 PM

    You can either export the WSDL in a sbconfig.jar and then import this sbconfig.jar in the new domain. Then you can create a new Proxy in new domain based on the WSDL you imported.
    Alternatively, you can open the WSDL in the old domain, copy the text content of WSDL, then open new domain sbconsole and create a new WSDL type resource and paste the content you copied from old domain WSDL here. Then you can create a new Proxy Service based on this WSDL resource you created.
    Although, may I ask why do you need to create this new Proxy Service on a different domain? If you want to create a service similar to existing Proxy Service on different domain, then you can export the existing proxy service along with any dependencies to a sbconfig.jar and them import them in any other domain.
    If you want your new Proxy Service to invoke the existing Proxy on different domain, then you need to create a Business Service in the new domain (calling domain) which can invoke your existing Proxy service in other domain.

  • How can i create proxy service from wsdl on different domain

    i have a demo webservice. it has many operations on proxy service's message flow. How can i create proxy service from demo's wsdl on different domain

    Hi fresh man
    This is the Oracle Forms forum, and your query has nothing to do with Forms.
    Please post on {forum:id=75}.
    Please search first. It usually helps to search before you post.
    Regards,

  • How can I get right data in a cell of JTable when table  enter editing

    how can I get right data in a cell of JTable when table enter editing

    how can I get right data in a cell of JTable when table enter editing

  • How can I create back up from ipad 2 before opting for restore setting

    how can I create back up in my computer from ipad2 before opting for restore setting, as I have forget my password for ipad and it has been diabled and not at all open by making several attempt

    Recovery Mode:
    1. Turn off iPad
    2. Connect USB cable to computer; leave the other end alone
    3. Press and hold the Home button down and connect the docking end of cable to iPad
    4. Continue holding the Home button until you see the "Connect To iTune" screen
    5. Release the Home button
    6. Open iTune
    7. You should see "iTunes has detected an iPad in recovery mode"
    8. Use iTune to restore iPad
    Note: You need to be patient and repeat the above many times to recover your iPad

  • How can I create a Report from a SWT-Application?

    Post Author: mkoch
    CA Forum: JAVA
    I'm a Developer and new to Crystal Reports and I have the job to create a Report from a SWT-Application.The report-files ( *.rpt) were created with Crystal Reports 10 or 11.> I'm not sure but I have access to a machine where Crystal Reports 10 Developer an Crystal Reports 11 Runtime are installed.Can anybody describe in detail how I can start the creation of a report from my Java-Application?> What libraries are needed, where can I get them and so on.I saw in the CR10-Setup that there is a Java-feature - but unfortunately this is not installed on my test-machine.--> Is it necessary to install this feature or can I get this files on businessobjects.com?Is it possible to start the report-creation from command-line?I saw a Java-example on the internet which uses Report.exe - but I haven't found this on my machine.I hope, that somebody can help me.GreetingsMarkus

    Inv. #
    Item
    Sale Price
    Lisa
    Oct Sold 12
    Oct Sold 12-2
    Oct Sold 12-3
    149
    Vase Lidded
    25
    201
    Bird
    7
    7
    202
    Bird
    7
    203
    Bird
    7
    204
    Bird
    7
    7
    205
    Bird
    7
    7
    206
    Bird
    7
    7
    207
    Bird
    7
    207
    Bird
    7
    7
    208
    Bird
    7
    7
    209
    Bird
    7
    7
    This is my very simple inventory.  On previous program I could sort by those items that did not have any figure in the row across.  Then I could print a report of open inventory.  Such as 149 Lidded Vase has not sales amount in the four colums across, thus it is open inventory.  How can I capture all those items in one report?

  • How can I trigger an event from an ABAP Program

    Hi everyone,
    I have a requirement, where I have to create an ABAP program, that has to execute (trigger) an event which belongs to a Process Chain. when I run the program, the Process Chain has to run.
    So, how can I do it?
    Thanks for your help, Federico

    HI ,
    The program can call function module BP_EVENT_RAISE to raise the event. you can create vent in sm64 and sm62 .There you give the parameter of the event same as what you will define in the event of start variant of your process chian ..
    Regards,
    shikha

  • How can I delete Facebook events from my macbook calendar?

    I'm using a MacBook Pro. I want to know how to delete Facebook events from my computers calendar, because it's taking up space and preventing me from seeing other events on that day.
    BUT, every time I try to delete it, an error message pops up "Only the calendar administrator and any delegates with permission can make changes to read-only calendars. To make changes to the calendar, contact the calendar administrator."
    And I can't delete the event. Have not tried declining the event because I don't wanna offend the person who invited me.
    Not a computer whiz, so idk if this helps but:
    MacBook Pro
    OS X Version 10.9.4
    Processor 2.5 GHz Intel Core i5
    Memory 8 GB 1600 MHz DDR3

    How can I remove individual facebook events from my calendar on my iPhone with iOS6?

  • Can't create Calendar Event from Mail on my iPad anymore

    I no longer can create a new iPad Calendar Event from tapping on a date in email I receive.  The new Event dialog box will still appear when I click on the date in an email, but the dialog box is now too small and off-center, hiding the Done button in the upper right corner of the Dialog. Without the Done button, I can't create the new Calendar Event.  I can't resize the dialog box, or re-center it. 
    Is this a common problem after the latest iOS update?  Can anyone help?  Thanks.

    This still works for me in iOS 6.1.3
    Have you tried restarting or resetting your iPad?
    Restart: Press On/Off button until the Slide to Power Off slider appears, select Slide to Power Off and, after the iPad shuts down, then press the On/Off button until the Apple logo appears.
    Reset: Press the Home and On/Off buttons at the same time and hold them until the Apple logo appears (about 10 seconds). Ignore the "Slide to power off"

  • How Can I Create an Event Link to a Page Tab?

    I have a portlet in one tab that generates an event. I want to be able to send this event to the same page but to another tab where another portlet resides. Here's the code snippet that creates the link. This code is part of a custom JSP tag.
    // Attempt to get access to the portlet render request to determine if we are within a portal context.
    PortletRenderRequest prr = (PortletRenderRequest) pageContext.getRequest().getAttribute(
        HttpCommonConstants.PORTLET_RENDER_REQUEST);
    if (null != prr)
        try
            // Set up the parameters used for the link.
            NameValue[] eventParameters =
                new NameValue("linkUrl", linkUrlParamValue)
            // Construct the link parameter we will be using.
            linkUrl = EventUtils.constructEventLink(prr, "linkClicked", eventParameters, true, true);
        catch (PortletException e)
            // Error processing removed...
    }This code will generate the event correctly and all processing occurs as expected. However, I cannot find a way to force the second tab to display.
    I am able to force the the second tab to be displayed if I use "Direct Access URLs". These links are in the form
    [protocol]://[host]:[port]/pls/portal/url/page/[page_group_root_page_name]/[tab_name]
    But is there a way to create an event link using a specific URL?

    Hi,
    One workaround that i can think of is:
    1. Set the <passAllUrlParams>true</passAllUrlParams> attribute in your provider.xml of the portlet on the target page/tab.(dont forget to refresh the provider)
    2. If you already have the url to the tab, then you just simply construct the form in your previous portlet to post to that url with all the necessary form fields.
    3. Process the request parameters and render the second portlet.
    hope that helps.
    thanks,
    Harsha

  • How can I create a negative from image in iPhoto

    I wish to create a negative from an image in iPhoto so I can print as if the negative. Is it possible to do this in iPhoto?

    GraphicConverter, Pixelmator  and Photoshop Elements for Mac all have the invert function.

  • How can I create one pdf from a FrameMaker Book with mixed page sizes.

    Looking for an easier way to create one pdf from a FrameMaker book that has files with different pages sizes; letter and tabloid.
    So far, I have not been able to find a way to set up the Adobe PDF printer or Distiller to read the page size from the source files in the book and then create one pdf with the appropriate page sizes based on the file sizes in the FrameMaker book. I can create a pdf of the book using a multi-step process where I create a pdf for each page size and then combine them into one file. This is a lot of work.
    Is there a way to set the Adobe PDF printer where it reads page size from the source files and then creates one pdf with a mixed page sizes?
    Using FrameMaker 7 and 10 and Acrobat X Pro.
    Thanks for any suggestions

    http://forums.adobe.com/message/4013068#4013068
    http://forums.adobe.com/message/3519366#3519366
    http://forums.adobe.com/thread/485331?tstart=0

  • How can I create 50p footage from 50i in Premiere or After FX?

    Hi,
    I'm trying to create 50p footage from 50i. Not 25p! I want to create 50p footage through a process that it is used in 100 HZ LCD TV sets
    This is the idea. If you have 50i footage you can easily interpolate fields and get a 25p footage. Fine.
    But I would like not to do a simple interpolation.
    Let's say I have two 50i frames. I want to create a frame between the two made with the lower field of the first one and the upper field from the second one . This is the process used by 100 Hz LCD monitors that can actually invent non-existent frames by this method.
    But Premiere doesn't work this way.
    If you try to export a 50i footage to 50p what you get is 50p footage with identical frames at twos (1=2, 3=4, etc..)
    You can try a slightly different approach.
    You can slow down 50% the 50i footage (and then speed it up again). This forces Premiere to interpolate and create an extra frame but.. here is the problem.. Premiere "thinks in frames".. and interpolates a totally new interlaced frame. This frame, coming from interpolation, is actually a "fake" frame Comes from nowhere and so it has much less definition then the originals (the one before and the one afterwards). If then you render, speed up at 200% and watch the result what you see is a good frame, a blurred frame, a good frame, a blurred frame, etc..
    Does anybody know a method of getting out 50 real interlaced or progressive frames with this composition?
    INTERLACED  (100i):  1U1L 1L2U 2U2L 2L3U 3U3L
    PROGRESSIVE 50p): (1U1L) (1L2U) (2U2L) (2L3U) (3U3L)   .... That is exactly as interlaced but with the two fields interpolated
    Also please note that this method applied on an edited movie creates smooth transitions at cuts (a frame that has 1 field from the scene before and one form the scene after).
    thanks,
    Marcello

    I would do this outside of Premiere.
    Here's a thread to pull.
    Though the web site information deals with NTSC, the script's author (Dan Isaacs) has built in several PAL options as well.  I've just never used them.

Maybe you are looking for

  • Help with connecting my iPad to tv

    Hi, I am trying to connect my iPad 2 to my tv I have no Hdmi port and using a av cable for the iPad I get sound but no picture what else do I do. The shop said I just connect that and it will work

  • Intel ICH5Raid & radeon 9700pro incompatable

    I have recently switched from promise to intel sata raid. My system performance in 3dmark/games dropped a great deal. After hours of trial & error I have discovered its the graphics card (radeon 9700pro) for some reason it is running with no agp memo

  • In incoming calls phone freezes and reboots

    Hi I got my Jelly Bean 4.1 update and whenever there is an incoming call, my Galaxy Nexus phone freezes and reboots when the caller ends the call. Is this a known issue? What can I do to have this issue fixed. Thank you

  • Can't load more than 6 tabs simultaneously

    If I try to open a large group of tabs all at once, the first few will manage to load before stalling out. After that, none of the tabs will load any further. Some stall part way through; most stall without showing any more than a blank page. If I st

  • BerkeleyDB configuration on Solaris

    Hi I m using Berkeleydb 4.2.52 with solaris x86 10.My berkeley db directory is /usr/BERKELEYDB.When i run this cmd /usr/BERKELEYDB/build_unix ../dist/configure then it shows me the error checking build system type... i386-pc-solaris2.10 checking host