Headache: Data Xchange from JDialog to JTable using JButton

My head is spinning about how to get this to work. What is really confusing me is the data exchange from the JDialog.
I have a JTable where one of the columns uses a JButton as the cell editor for each cell in that column. That part seems to be no problem. The JButton is labeled "Define Staff..."
When the user clicks on the JButton, a JDialog containing a JList is to appear. If the user clicks cancel, the JDialog is disposed and nothing happens. If the user clicks OK, the selected items are to be returned to the cell in some way and the label of the JButton is to change to "Modify Staff..."
How can I return the list from the JDialog to the "cell" so that when I access the cell using getValueAt() I get the list of values, and not the JButton object?

Thanks.
The actual JButton is inside a JTable cell though.
Where would I add the event handler for the button? In the editor? In the renderer?
Excerpt from the JTable file:
     PositionTable.getColumn("Staff").setCellRenderer(new ButtonRenderer());
     PositionTable.getColumn("Staff").setCellEditor(new ButtonEditor(new JCheckBox()));ButtonEditor.java
public class ButtonEditor extends DefaultCellEditor {
  protected JButton button;
  private String    label;
  private boolean   isPushed;
  public ButtonEditor(JCheckBox checkBox) {
    super(checkBox);
    button = new JButton();
    button.setOpaque(true);
    button.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        fireEditingStopped();
  public Component getTableCellEditorComponent(JTable table, Object value,
                   boolean isSelected, int row, int column) {
    if (isSelected) {
    } else{
      button.setForeground(table.getForeground());
      button.setBackground(table.getBackground());
    label = (value ==null) ? "" : value.toString();
    isPushed = true;
    return button;
  public Vector<String> getCellEditorValue() {
    Vector<String> staff = new Vector<String>();
    if (isPushed)  {
      staffSelector temp = new staffSelector(null,true,"Building Supervisor");
      temp.setVisible(true);
      staff = temp.getSelectedStaff(true);
    isPushed = false;
   // return new String( label ) ;
   //Return vector people selected.
   return staff;
  public boolean stopCellEditing() {
    isPushed = false;
    return super.stopCellEditing();
  protected void fireEditingStopped() {
    super.fireEditingStopped();
}ButtonRenderer.java
public class ButtonRenderer extends JButton implements TableCellRenderer {
  public ButtonRenderer() {
    setOpaque(true);
  public Component getTableCellRendererComponent(JTable table, Object value,
                   boolean isSelected, boolean hasFocus, int row, int column) {
    if (isSelected) {
      setForeground(table.getForeground());
      setBackground(table.getBackground());
    } else{
      setForeground(table.getForeground());
      setBackground(UIManager.getColor("Button.background"));
    setText( (value ==null) ? "Define Staff..." : "Modify Staff..." );
    return this;
}Message was edited by:
AsymptoticCoder
Made an error.

Similar Messages

  • Unable to delete data files from my Ipod if used as data storage...

    Hello everybody
    I bought months ago an Ipod Nano 8GB. I've got an issue when i use it as disk storage i'm not able to sort out. I've checked all the topics but i cannot find any solution.
    Example: I use the Ipod with the option "Manually manage music and videos". I put audio and video files on my Ipod through Itunes, then i put also some files on my Ipod as normal data files through my Mac Finder (Easy, i drag VLC, JPG files etc. from folders to my Ipod). The Ipod/Itunes summary page shows (Correctly) the capacity column colored in blue (Audio), video (Purple) and orange (Data). No probs when i transfer data files to another computer.
    Problem: when i delete the data files from my Ipod (Through finder) the orange column doesn't disappear (I have no problems if i delete audio/video files via Itunes) and although i've actually deleted all the files if i try to add some other data or videos/music files to my Ipod, Itunes says that there is no space available in my device. It's very strange, i check and double check all the options but eventually i have to restore my Ipod all the times and (Pretty annoying) add all my files again.
    It seems that although i sent my files to the trash bin, Itunes (Fully updated) doesn't recognize the change.
    It'd be great if someone can help me out as it's very important for me to be able to use my Ipod as disk storage, thanks a lot!

    It seems that although i sent my files to the trash bin, Itunes (Fully updated) doesn't recognize the change.
    Empty it from the Finder menu or by control-clicking it in the Dock.
    (44613)

  • Data transfer from mac to pc using ipod

    I need to transfer some data files from my MacBook to my PC using my 30GB ipod. I get all the files copied onto my ipod from my mac with no problems. I have my ipod set to be used in disk mode.
    Once I plug it into my pc, it tells me that I need to format the drive. How can I successfully transfer data from my mac to my pc using my 30GB ipod?
    Someone told me to go ahead and format the drive/ipod on my pc and then plug it into my mac, place the files in the ipod and then I should be able to access the files having the ipod plugged into my pc. I started to try this, but it messes up my ipod to where I need to reset my ipod to factory settings using, my macbook.
    Would it be possible to reset my ipod to factory settings using itunes on my pc and then try plug the ipod into my macbook and copy the files over that way?
    Please let me know what you have found out. I need to backup all my files and get them on to a second computer. I have 25GB worth of home videos that makes it so that I need to use my ipod, other wise another device would do the trick.

    eternalfam wrote:
    Would it be possible to reset my ipod to factory settings using itunes on my pc and then try plug the ipod into my macbook and copy the files over that way?
    Yes. In fact, I'm pretty sure that's what you were supposed to do in the first place. The wonderful thing about OS X: It'll speak HFS+, FAT32, and it'll even understand NTFS (but it can't write to it... yet). Oddest thing: XBox 360 will read HFS+, but WinXP/Vista won't... curious, isn't it?

  • Data updation from R3 to CRM using CRM_DATAEXCHG_BADI.

    Hi,
    While transferring the data of equipements from R3 to CRM, we want to transfer the status of the equipement (data element J_STACT).
    I am using IF_EX_CRM_DATAEXCHG_BADI~CRM_DATAEXCH_R3D_MBDOC_FILL to update the status before transferring the data to CRM.
    Here I am getting status of equipment from R3. Now how do I update the status in ct_bus_trans_msg.
    I need to update ct_bus_trans_msg-ORDPRP_OBJL_I_D-IOBJECT_ID.
    Thank you.

    Hi,
    Internal table ct_bus_trans_msg  have several segments.
    These segments are similar to Bdoc meaasge.
    There is segment called STATUS_H. You need to populate this segment with status form R/3.
    Please reward points if useful
    Murali

  • Data extraction from Siebel to BW - use BC or not

    Hello
    I am doing data extraction from Siebel to BW. I can map just 15% of Siebel fields to SAP BC data sources. Do you still recommend me to use BC or forget it and create whole buch of new infoobjects and custom ods/cubes?

    Hi,
    If data is comming from out of SAP, then carefully select the infoObects, because SAP provided InfoObjects are more meaningful and better integration with other infoobjects(Compound Objects, Navigational and so on).If You are created any custom objects, You have to take care all of them in overall design and architecture.
    I am prefering first to choose existing BC Infoobjects, if not available and then create new objects. But here You need lot of functional knowledge also

  • Data upload from R3 to BPC using filters

    We are facing a performance issue on the uploading data flow from R3 to BPC. Two steps have been set up.
    Step1: R/3 --> ODS --> BW CUBE (No filters and full mode)
    Step2: BW  CUBE --> BPC CUBE (Standard BW upload package)
    The first one (from R3 to a BW Cube) has no filters, so it loads every data and it takes too much time. However, the second one (from the Cube to BPC)  has filtering options, so we can only load the data we need to (we usually use entity and time filters).
    Both are executed from the BPC DataManager.
    Any advice to improve the performance of the first step? Could we join the step 1 and step 2 and get the filters from the standard BW upload process using a custom process chain?
    Does anybody have any experience using filters to reduce the amount of records on the data uploading from R/3 to BPC?
    BPC Version 7.50.15

    Hi,
    for example in BI data is stored as below
    GroupAcc - Date - Balance
    100000 - 12.12.10 - 400
    **I'm not quite sure how you are getting the above data from infocube.Are you directly loading data from PSA to infocube with out loading data into DSO -0FIGL_O10(General ledger(New):Transaction figures) ?
    To get required format of following data, no need to do any thing while laoding the data into BPC. Your BI infocube should maitain the data in below format.
    GroupAcc - Date - Balance
    100000 - 12.12.10 - 100 - (LC)
    100000 - 12.12.10 - 100 - (TC)
    100000 - 12.12.10 - 200 - (GC)
    To acheive above format of data in the infocube please follow standard way of data flow given by SAP in BI Contect(http://help.sap.com/saphelp_nw70ehp1/helpdata/en/e6/f16940c3c7bf49e10000000a1550b0/frameset.htm).
    Flow should be
    R/3 --> PSA --> DSO -->Infocube.
    In this flow its important to remember about infoobect 0CURKEY_TC in DSO.
    This is always the currency key of the transaction currency; it is also filled for records with a different currency type. Without this key field, postings with different transaction currencies would be overwritten after summarization and thereby be lost.
    (http://help.sap.com/saphelp_nw70ehp1/helpdata/en/a8/e26840b151181ce10000000a1550b0/content.htm)
    Once you follow the standard flow, your infocube contains the requried format (LC,TC and GC )of data to load it into BPC application.
    hope it helps...
    regards,
    Raju

  • DATA TRANSLATION FROM GAAP TO IFRS USING BFC STARTER KIT

    Dear All,
    1.Does the Starter Pack provide data translation from GAAP to IFRS especially when the underlying GL is a non-SAP GL?
    2.What are the specific u201CAutomated controls, business rules and calculationsu201D that are performed in the starter kit as stated in the presentation?
    3.For banks not using SAP ERP, what combination of SAP solution will you advise that they take and why, if they must beat the January 1, 2012 deadline.
    4. Where SAP GL is in place, what relevance will the IFRS Starter pack provide?
    5. Can't I just build a universe in BOBJ to do the data translation from GAAP to IFRS and display the report in the IFRS format?
    Thanks for your advice

    Hi and sorry for the late answer.
    You may find answers to your questions in the paper about "IFRS adoption in consolidated statements with BOFC".[http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/30effe30-6c44-2d10-c48a-fb26102b0bf6]
    Be aware that BOFC is a consolidation product, it doesn't cover the same areas as the GL.
    Regards
    JF
    Would you need further information, or real-time update on all new IFRS/XBRL assets for SAP BusinessObjects solutions I would recommend you join the following social media:
    - Facebook http://www.facebook.com/sapifrs
    - Twitter http://twitter.com/SAP_IFRS_XBRL 
    - LinkedIn http://www.linkedin.com/groups?mostPopular=&gid=1851849

  • Data acquisition from NI PXI 5152 using LabVIEW

    Hi,
        This might be really stupid question, I am new to LabVIEW and the Digitizer equipment. I was wondering if there are already any labVIEW based application available to read the data from PXI5152. I would be using both channels available and may be trigger. If there is no such application available, what would be port numbers I would be using for data acquisition. But, If I am to develop an acquisition software, I would be looking at every single specification of the equipment. I am assuming the output will be a digitized signal varying with the clock input, since It is used as oscilloscope. When working with labview how would I specify the port to read from and how would my PC recognize the port. I working on a pre-configured system and they won't let me unplug anything to check the configuration. Does NI provides a software to read into the signal fed into the channel and trigger inputs. I have tried looking into the different forum discussion but didn't find any that address my issue. May be it's too simple and stupid. But, it would be a great help if you could point out my misunderstanding.
    Thanks in advance.
    BP

    There are numerous examples. Help>Find Examples> Modular Instruments>Ni-Scope. There is a test panel available in MAX. On the Measurement I/O>NI-Scope palette, are all of the driver functions includeing the NI-Scope Express.
    I'm not quite sure I understand your references to 'port's. Once installed into the chassis, it should be listed in MAX. In the functions you will be using, there will be a dropdown menu that you will be able to select the scope resource name.

  • Issue in Temp table creation in PCM Databridge and data migration from ecc to PCM using databridge

    Hi,
    we are working on mapping SAP PCM table structure data and the data which is coming from ECC.
    We are using Databridge tool to upload the data for the same,upload from databridge involves
    using Specification file to upload the data into SAP PCM.
    The problem we are facing is that
    The responsiblity center(cost center) in ECC and SAP PCm are different.There is one to many relationship between them
    eg 1 ecc cost center-->many SAP PCM cst center,we need to split the line item vale of one ecc cost center into many SAP PCM cost centers
    eg C1 cost center from ECC has value 4000 to be split across PCM1,PCM2,PCM3,PCM4 cost centers in SAP PCM
    we need to automate using the databridge ,we are stuck up in this task.
    Please guide us.
    Also we are trying to create temporary table usinf Table temporary command in SPE file of databridge.The purpose of this is to put the ECC data in temp table as per our req and then use the temp table as data source for putting data in PCm as per our requirement.
    Please advise us on this approach
    Regards
    Shrirang
    9552334897

    Schema's SYS,CTXSYS, MDSYS and ORDSYS are Not Exported using exp/expdp
    Doc ID: Note:228482.1
    I suppose he already installed a software 12c and created a database itseems - So when you imported you might have this "already exists"
    Whenever the database is created and software installed by default system,sys,sysaux will be created.

  • Error in Configuring Data Transfer From EMS to BAM using JMS

    Hi,
    Hi i am trying to import data from database into BAM dataobjects using JMS.
    I am able to get the data in JMS queue, but hav problem configuring BAM.
    After modifying the 2 xml files on BAM server and after making required changes on adminsrator on BAM console (Changing paths of jar files),
    I have to import some OBAM Artifacts. Refer
    - To import Oracle BAM artifacts needed for BAM server, perform the following steps,
    Copy $ORACLE_HOME/sysman/bam/emsys_all.xml into the BAM machine.
    Can anyone guide me to where can i get this file emsys_all.xml. I am not bale to locate it on my BAM server.

    Hi,
    The file that you referred to emsys_all.xml is for integrating BAM and Enterprise Manager
    More details on that can be found in
    Oracle® Enterprise Manager Management Connectors Integration Guide -
    http://www.oracle.com/technology/products/integration/bam/10.1.3/TechNotes/em_de.pdf
    However this is not required for EMS working, take a look at this document,
    http://www.oracle.com/technology/products/integration/bam/10.1.3/TechNotes/TechNote_BAM_Configurefor1013OC4J.pdf
    that gives the steps for EMS.
    Thanks
    Ranga

  • Data transfer from RT to FPGA using DMA FIFO

    Hello all,
    My question is "How do you stream data from RT target to FPGA target using DMA FIFOs?"
    I would like to control some indicators (or controls) in FPGA vi using controls in the RT vi using DMA FIFO.
    I have used four controls in my RT vi, but I get only one indicator out on my FPGA vi. (I would actually like to use some controls on the FPGA target using controls on the RT target)
    Is this possible?
    Can anyone help me with this?
    I have attached my vi s. 
    Attachments:
    fpgatest.vi ‏28 KB
    rt_test.vi ‏73 KB

    Based purely on your example, I see two options:
    1. Do as RavensFan suggests and use Boolean Array To Number to send a single number down to the FPGA.  Your FPGA can break up the number easily enough to update the indicators.
    2. Just write dirctly to the indicators.  I do not see a need for the DMA.  Again, based purely on your example.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Data retrieval from MDM 5.5 using Java API

    Hi,
    Does anyone have a sample Java code snippet that can be called via XI to retrieve data from a repository in MDM 5.5 ?
    Cheers
    Colin.

    Colin,
    What exactly do you want to do?
    If you want to retrieve data from MDM, you need to have Java application call the API's provided.
    Where is XI coming into picture?
    Other way of doing it is to develop a web service and call that via XI and send the data.
    Here is quick snippet to get some data.
    Sample code for FreeForm search:
    SearchParameters sparam = search.GetParameters ();
    FreeFormTableParameter fftParam =
    sparam.NewFreeFormTableParameter(ProductsTable);
    FreeFormParameterField ffParamField =
    fftParam.GetFields().New(PartNumberField);
    ffParamField.GetValues().NewString(
    partNoValue,FreeFormParameter.PrefixSearchType);
    search.Add(fftParam);
    Regards,
    Ravi
    Note : Please reward the posts that help you.

  • Data transfer from BW to CRM using infospoke.

    Dear All,
    I need to move data from BW to CRM box. I have created an info-spoke for business partner and need to move 3 attributes of business partner into three fields of business partner master data in CRM.
    These three fields are added in the BUT000 table. I have tried the RFC destination option in infospoke but somehow, i am not able to figure out how to move data from the info-object of business partner in BW to a table in CRM.
    Can someone help here ?
    Thanks,
    Mukund.

    Dear All,
    I need to move data from BW to CRM box. I have created an info-spoke for business partner and need to move 3 attributes of business partner into three fields of business partner master data in CRM.
    These three fields are added in the BUT000 table. I have tried the RFC destination option in infospoke but somehow, i am not able to figure out how to move data from the info-object of business partner in BW to a table in CRM.
    Can someone help here ?
    Thanks,
    Mukund.

  • Handling Data in JComboBox added to JTable using Rendrers

    Hi All,
    I have 3 columns with JCombobox with in a table.I have used Rendrers and Editors for handling them.
    Issue:
    In table,3 columns droplist have some values populated initially.When i change item in Column1 Droplist in row 0 ,then i have to dynamically populate values in to Column2 Droplist in "row 0 only".But i see the whole column2 Droplists are populated with the same values as in row0 which should not happen.Each row values should be independent of the other.
    My Implementation:
    Editor Calss:
    public class ComboBoxEditor extends JCombobox {
    // All the default editor method ovverriden here
    Please help me out in fixing this issue.
    Thanks in advance.
    cheers,
    sharath

    Maybe this is what you are looking for:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=566133
    If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
    And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the code retains its original formatting.

  • List View does not retain date formats from Excel

    i am using List View control to isplay data. When i scroll the horizontal bar inlist view, the date format changes to numbers. is there were to stop this happening.
    regards
    Chandra

    Hi Chandra,
    Are you getting the values from any live connection or is it static data from the excel file?
    You can also try to goto properties of component and in the appearence tab,select the format of the values as "DATE".
    Incase you are getting the values from the live connection, you can select a different cell which would reference to the data coming from the connection and use it into the components.
    e.g.: if values are coming in cell"A1" then goto some empty cell as B1 and type in"=A1" and use this new cell into the component.
    Let me know if this works.
    Thanks,
    Amit.

Maybe you are looking for

  • My ipad cannot find my printer

    I have an hp deskjet wireless printer but my ipad, iPhone or iPod touch cannot find it.  Sometimes my ipad can but it is intermittent and unreliable. Anyone any ideas

  • Dynamic sortation of objects in a document

    I am designing a project management solution and i am not sure if the functionaility is natively built in to do what i want or if we need to hire a developer to use scripting ui. I created a project management document that is more pleasing to the ey

  • 10.6.4 Update Broke Wireless Scanning to my HP C4700 Photosmart all in one

    I get an error "Trying to open scanner session..." when trying to scan wirelessly. Worked in 10.6.3.

  • Button as opposed to a layer

    I created a banner ad with actionscripts for 3rd party ad servers.  I created the button as a layer, but the media company had this to say about my banner ad....how do I do this? With  regards to the .FLA and .SWF files, they were tested.  While the 

  • Is there any way to send IDOC in one line through JMS Adaptor?

    Hi Frnds, I have an issue with JMS adaptor and it is as folllow: I configured JMS sender Communicaiton Channel and its working fine but client wants header and item records in one line with out any lines in between these records. Is it possible to se