Linking combo boxes to a table

I have made a set of combo boxes that allow the user to input a home and away football team and their scores. I have also setup a table with 4 teams in it. How can i link the combo boxes so that EG:
If Arsenal 2 - 1 Chelsea is a result inputted how can i link it to a table so that Arsenal will go top with 3 points, 2 goal for, 1 against etc
Basically i need to update the table from the info supplied by the combo boxes???

we don't tolerate that attitude either....
besides I gave u guidelines, check the other thread, but u can be sure that nobody will help you if u keep this attitude...
READ the links I posted in that other thread, work on the issue then come back with questions and post your code so that we know how to help you based on your code..that's how it works here..

Similar Messages

  • Problem in showing combo box in the table

    Hello guys i just add up the combo box in the table but the problem is when i change the line in the table the combo disappear. i want it to be visible even if it is not in the selected row. i want that user can see the combo box in the table without clicking on it.
    Please help;

    http://java.sun.com/docs/books/tutorial/uiswing/components/table.html
    Look in the page bottom !

  • Combo box in a table column

    I have dragged and dropped one of my view objects as a table on a JClient form. Is there a way I can show one of the columns as a combo box?
    Milos

    URGENT!!!!!!!! Using a topic title like "URGENT" followed by exclamations is one sure way to not get an answer from people on the forum.
    This is urgent... Not for us it isn't. Implying that your question is any more important than any other question on the forum is another way to not get a response.
    Anyway your question is like big run on sentence and I have no idea what you are asking or what your problem is or what your code looks like.
    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 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.

  • **urgent*** -two  combo boxes  -one  database table - ***urgent**

    1. i have one html page - in that two combo boxes are there
    2. first one called--> Bank Name and second one called-->Main Branch
    3. i have a database table like BANK_MASTER(MAIN_BRANCH,BANK_NAME)
    i am giving here some data for the above table:
    (sbi-kurnool, sbi),(sbi-cadapah,sbi),(sbi-chittor,sbi),(ab-rangareddy,ab),(ab-varangal,ab) ..like that every bank has its own main branch in different location.
    MY PROBLEM:
    In HTML page, in the first combo box ie., Bank Name will display all the bank name using the table BANK_MASTER ie.,sbi,ab,cb,sbh ...... (its ok - i too get )
    main Problem: Whenever i select a particular bank name in the first combo box, the second combo box ie.,Main Branch has to display the main branches using the table Bank_Master depending on the Selected bank name from the Bank Name Combo box ( ie., if we select the sbi, it has to display all main branches of sbi's only, but not other bank's main branches)

    Hi friend,
    I had a similar situation and i tried to solve it by using XmlHttpRequest Object(used in AJAX).
    U can checkout the below example just for further reference delete
    UserForm.jsp:
    ==========
    <head>
    <script>
    var xmlHttp
    function showState(str)
    xmlHttp=GetXmlHttpObject()
    if (xmlHttp==null)
    alert ("Browser does not support HTTP Request")
    return
    var url="getState.jsp"
    url=url+"?count="+str
    url=url+"&sid="+Math.random()
    xmlHttp.onreadystatechange=stateChange
    xmlHttp.open("GET",url,true)
    xmlHttp.send(null)
    function stateChange()
    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
    document.getElementById("state").innerHTML=xmlHttp.responseText
    </head>
    <body>
    <select name='country' onchange="showState(this.value)">
    <option value='india>india</option>
    </select>
    <br>
    <div id='state'>
    <select name='state' >
    <option value='-1'>pickone</option>
    </select>
    </div>
    </body>       
    getState.jsp
    ============
    <%@page language="java" import ="java.util.Hashtable" import ="java.util.Set" %>
    <%
    String country=request.getParameter("count");
    response.setContentType("text/html");
    response.setHeader("Cache-Control","no-cache");
    try{
    Hashtable ht = (Hashtable)session.getAttribute("<ATTRIBUTE_NAME>");
    String buffer="<select name='state'><option value='-1'>Pick One</option>";
    Set s=ht.keySet();
    Object keys[]=s.toArray();
    int size=keys.length;
    for(int i=0; i < size;i++){
    buffer=buffer+"<option value='"+ht.get(keys).toString()+"'>"+ht.get(keys).toString()+"</option>";
    buffer=buffer+"</select>";
    response.getWriter().println(buffer);
    catch(Exception exp){
    response.getWriter().println(exp);
    %> I think u may go upon replacing country with your Main Branch and vice versa

  • Help with linking combo boxes so that some options are made unavailable

    Hello!
    I'm having trouble setting up an interactive PDF form with multiple combo boxes.
    I have designed an interactive PDF form in InDesign CS6 but am doing the final preparation and formatting in Adobe Acrobat XI Pro.
    First of all, I am not sure if I should be using combo boxes or list boxes, but the combo box seemd to look better after I export the PDF and also left the field blank, ready for selection from the drop-down menu.
    Basically I have a list of drop-down lists, but not all combinations are compatible. For example, after maing "Selection 1" in "Combo box 1", I need only "Selection 1", "2", and "3" [out of the total 5] to be available in "Combo box 2".
    I need to be able to apply this algorhythm to the next few combo boxes as well.
    Moreover, I would need some of the checkboxes disabled [the user won't be able to check them at all]when I make a certain selection in some of the combo boxes.
    Needless to say, I don't know any Java, coding or making calculations in LiveCycle Designer, so I don't even know where to begin.
    I have attached a screen grab of my form and what I want to achieve.
    Any help would be very much appreciated.
    Thank you!

    If it is static data, I would suggest you to cache it rather than having it in each of the user session. You can have configuration/code to refresh when needed. Please look at any available caching frameworks (EhCache, OSCache etc...)

  • [php+mysql] linked combo box in insert form?

    Hi all,
    I would like to add two list box on the same insert form.
    The two list box should be linked each other with a 1:1 relation.
    The data in the two compo box could be static data; no need to use
    dynamic data here).
    Selecting from list box 1 will automatically select the related value
    from list box 2.
    Vice versa, selecting a value on list box 2 will automatically select
    the related value on list box 1.
    Is there a way to do this using ADDT?
    TIA
    tony

    >Hi Tony,
    >
    >did you read my reply to your very similar question "Dependent drop down or not?" in this thread:
    >
    >Cheers,
    >Günter Schenk
    >Adobe Community Expert, Dreamweaver
    Hi Gunter,
    No, I've seen your post just now. :(.
    I too I've never seen nothing similar, but the customer said that the
    last year another company have done this for him. But I haven't seen
    those pages and we can't get the source code :(.
    Perhaps a dropdown menu showing two fields could help.
    Or, even better, an editable drop down menu that allow you to type
    something and it will autocomplete automatically using the first field
    or the second field.
    Is this possible?
    TIA Gunter.
    tony

  • Link Combo box(drop down) to Column chart

    Hello Gurus,
    I am new to this Xcelsius world...  I have 3 excel books with three different weeks data, i would like to create drop down for thr three week and link to the column bar chart with filter.
    could you please help me any one.
    thanks in adavance
    Muvva

    Hi Anil,
      I am trying to display the data in the spread sheet using the web services. I am able to get the web service as a query in xcelsius and i am trying to insert into excel and then i would to display in the spreadsheet table. I am unable to see the data in the excel and the spreadsheet  action block.
    Muvva

  • Add combo box into table pagination

    I want to add combo box into JavaFX table with pagination. Something like that:
    import javafx.application.Application;
    import javafx.beans.property.SimpleStringProperty;
    import javafx.collections.FXCollections;
    import javafx.collections.ObservableList;
    import javafx.scene.Node;
    import javafx.scene.Scene;
    import javafx.scene.control.Pagination;
    import javafx.scene.control.TableColumn;
    import javafx.scene.control.TableView;
    import javafx.scene.control.cell.PropertyValueFactory;
    import javafx.scene.layout.AnchorPane;
    import javafx.scene.layout.VBox;
    import javafx.stage.Stage;
    import javafx.util.Callback;
    public class MainApp extends Application
       final ObservableList<Person> data = FXCollections.observableArrayList(
       new Person("1", "Joe", "Pesci"),
       new Person("2", "Audrey", "Hepburn"),
       new Person("3", "Gregory", "Peck")
       private Pagination pagination;
       public static void main(String[] args) throws Exception
      launch(args);
       public int itemsPerPage()
       return 1;
       public int rowsPerPage()
       return 5;
       public VBox createPage(int pageIndex)
       int lastIndex = 0;
       int displace = data.size() % rowsPerPage();
       if (displace > 0)
      lastIndex = data.size() / rowsPerPage();
       else
      lastIndex = data.size() / rowsPerPage() - 1;
       VBox box = new VBox(5);
       int page = pageIndex * itemsPerPage();
       for (int i = page; i < page + itemsPerPage(); i++)
       TableView<Person> table = new TableView<>();
       TableColumn numCol = new TableColumn("ID");
      numCol.setCellValueFactory(
       new PropertyValueFactory<Person, String>("num"));
      numCol.setMinWidth(20);
       TableColumn firstNameCol = new TableColumn("First Name");
      firstNameCol.setCellValueFactory(
       new PropertyValueFactory<Person, String>("firstName"));
      firstNameCol.setMinWidth(160);
       TableColumn lastNameCol = new TableColumn("Last Name");
      lastNameCol.setCellValueFactory(
       new PropertyValueFactory<Person, String>("lastName"));
      lastNameCol.setMinWidth(160);
      table.getColumns().addAll(numCol, firstNameCol, lastNameCol);
       if (lastIndex == pageIndex)
      table.setItems(FXCollections.observableArrayList(data.subList(pageIndex * rowsPerPage(), pageIndex * rowsPerPage() + displace)));
       else
      table.setItems(FXCollections.observableArrayList(data.subList(pageIndex * rowsPerPage(), pageIndex * rowsPerPage() + rowsPerPage())));
      box.getChildren().add(table);
       return box;
       @Override
       public void start(final Stage stage) throws Exception
      pagination = new Pagination((data.size() / rowsPerPage() + 1), 0);
       // pagination = new Pagination(20 , 0);
       //pagination.setStyle("-fx-border-color:red;");
      pagination.setPageFactory(new Callback<Integer, Node>()
       @Override
       public Node call(Integer pageIndex)
       if (pageIndex > data.size() / rowsPerPage() + 1)
       return null;
       else
       return createPage(pageIndex);
       public static class Person
       private final SimpleStringProperty num;
       private final SimpleStringProperty firstName;
       private final SimpleStringProperty lastName;
       private Person(String id, String fName, String lName)
       this.firstName = new SimpleStringProperty(fName);
       this.lastName = new SimpleStringProperty(lName);
       this.num = new SimpleStringProperty(id);
       public String getFirstName()
       return firstName.get();
       public void setFirstName(String fName)
      firstName.set(fName);
       public String getLastName()
       return lastName.get();
       public void setLastName(String fName)
      lastName.set(fName);
       public String getNum()
       return num.get();
       public void setNum(String id)
      num.set(id);
    I suppose that this can be done with StackPane but I need some other more universal way to do this because I want to expand the table size. I need to place there the combo box always in a fix position.
    Ref http://stackoverflow.com/questions/21147261/add-combo-box-into-table-pagination

    Hi. You can do it using an AnchorPane:
    AnchorPane.setBottomAnchor(comboBox, 40.0);
    AnchorPane.setLeftAnchor(comboBox, 12.0);
    The complete  example :
    import java.util.List;
    import javafx.application.Application;
    import javafx.beans.property.SimpleStringProperty;
    import javafx.collections.FXCollections;
    import javafx.collections.ListChangeListener;
    import javafx.collections.ListChangeListener.Change;
    import javafx.collections.ObservableList;
    import javafx.scene.Scene;
    import javafx.scene.control.Pagination;
    import javafx.scene.Node;
    import javafx.scene.control.ComboBox;
    import javafx.scene.control.TableColumn;
    import javafx.scene.control.TableView;
    import javafx.scene.control.TextArea;
    import javafx.scene.control.cell.PropertyValueFactory;
    import javafx.scene.layout.AnchorPane;
    import javafx.scene.layout.VBox;
    import javafx.stage.Stage;
    import javafx.util.Callback;
    public class TablePager extends Application {
        final ObservableList<Person> data = FXCollections.observableArrayList(
                new Person("1", "Joe", "Pesci"),
                new Person("2", "Audrey", "Hepburn"),
                new Person("3", "Gregory", "Peck"),
                new Person("4", "Cary", "Grant"),
                new Person("5", "De", "Niro"),
                new Person("6", "Katharine", "Hepburn"),
                new Person("7", "Jack", "Nicholson"),
                new Person("8", "Morgan", "Freeman"),
                new Person("9", "Elizabeth", "Taylor"),
                new Person("10", "Marcello", "Mastroianni"),
                new Person("11", "Innokenty", "Smoktunovsky"),
                new Person("12", "Sophia", "Loren"),
                new Person("13", "Alexander", "Kalyagin"),
                new Person("14", "Peter", "OToole"),
                new Person("15", "Gene", "Wilder"),
                new Person("16", "Evgeny", "Evstegneev"),
                new Person("17", "Michael", "Caine"),
                new Person("18", "Jean-Paul", "Belmondo"),
                new Person("19", " Julia", "Roberts"),
                new Person("20", "James", "Stewart"),
                new Person("21", "Sandra", "Bullock"),
                new Person("22", "Paul", "Newman"),
                new Person("23", "Oleg", "Tabakov"),
                new Person("24", "Mary", "Steenburgen"),
                new Person("25", "Jackie", "Chan"),
                new Person("26", "Rodney", "Dangerfield"),
                new Person("27", "Betty", "White"),
                new Person("28", "Eddie", "Murphy"),
                new Person("29", "Amitabh", "Bachchan"),
                new Person("30", "Nicole", "Kidman"),
                new Person("31", "Adriano", "Celentano"),
                new Person("32", "Rhonda", " Fleming's"),
                new Person("32", "Humphrey", "Bogart"));
        private Pagination pagination;
        public static void main(String[] args) throws Exception {
            launch(args);
        public int itemsPerPage() {
            return 1;
        public int rowsPerPage() {
            return 5;
        public VBox createPage(int pageIndex) {
            int lastIndex = 0;
            int displace = data.size() % rowsPerPage();
            if (displace > 0) {
                lastIndex = data.size() / rowsPerPage();
            } else {
                lastIndex = data.size() / rowsPerPage() - 1;
            VBox box = new VBox();
            int page = pageIndex * itemsPerPage();
            for (int i = page; i < page + itemsPerPage(); i++) {
                TableView<Person> table = new TableView<Person>();
                TableColumn numCol = new TableColumn("ID");
                numCol.setCellValueFactory(
                        new PropertyValueFactory<Person, String>("num"));
                numCol.setMinWidth(20);
                TableColumn firstNameCol = new TableColumn("First Name");
                firstNameCol.setCellValueFactory(
                        new PropertyValueFactory<Person, String>("firstName"));
                firstNameCol.setMinWidth(160);
                TableColumn lastNameCol = new TableColumn("Last Name");
                lastNameCol.setCellValueFactory(
                        new PropertyValueFactory<Person, String>("lastName"));
                lastNameCol.setMinWidth(160);
                table.getColumns().addAll(numCol, firstNameCol, lastNameCol);
                if (lastIndex == pageIndex) {
                    table.setItems(FXCollections.observableArrayList(data.subList(pageIndex * rowsPerPage(), pageIndex * rowsPerPage() + displace)));
                } else {
                    table.setItems(FXCollections.observableArrayList(data.subList(pageIndex * rowsPerPage(), pageIndex * rowsPerPage() + rowsPerPage())));
                box.getChildren().addAll(table);
            return box;
        @Override
        public void start(final Stage stage) throws Exception {
            ObservableList<String> options =
                    FXCollections.observableArrayList(
                    "Opt1",
                    "Opt2",
                    "Opt3");
            final ComboBox comboBox = new ComboBox(options);
            pagination = new Pagination((data.size() / rowsPerPage() + 1), 0);
            //   pagination = new Pagination(20 , 0);
            pagination.setStyle("-fx-border-color:red;");
            pagination.setPageFactory(new Callback<Integer, Node>() {
                @Override
                public Node call(Integer pageIndex) {
                    if (pageIndex > data.size() / rowsPerPage() + 1) {
                        return null;
                    } else {
                        return createPage(pageIndex);
            AnchorPane anchor = new AnchorPane();
            AnchorPane.setTopAnchor(pagination, 10.0);
            AnchorPane.setRightAnchor(pagination, 10.0);
            AnchorPane.setBottomAnchor(pagination, 10.0);
            AnchorPane.setLeftAnchor(pagination, 10.0);
            Scene scene = new Scene(anchor, 400, 250);
            AnchorPane.setBottomAnchor(comboBox, 40.0);
            AnchorPane.setLeftAnchor(comboBox, 12.0);
            anchor.getChildren().addAll(pagination, comboBox);
            stage.setScene(scene);
            stage.setTitle("Table pager");
            stage.show();
        public static class Person {
            private final SimpleStringProperty num;
            private final SimpleStringProperty firstName;
            private final SimpleStringProperty lastName;
            private Person(String id, String fName, String lName) {
                this.firstName = new SimpleStringProperty(fName);
                this.lastName = new SimpleStringProperty(lName);
                this.num = new SimpleStringProperty(id);
            public String getFirstName() {
                return firstName.get();
            public void setFirstName(String fName) {
                firstName.set(fName);
            public String getLastName() {
                return lastName.get();
            public void setLastName(String fName) {
                lastName.set(fName);
            public String getNum() {
                return num.get();
            public void setNum(String id) {
                num.set(id);

  • Editable Combo box in a JTable

    Hi,
    Is it possible to have an editable combo Box in a JTable with an item Listener attached to the combo Box?
    Based on whatever value the user enters in that column that is rendered as a combo Box(editable) i should be able to do some validation. Is this possible?
    Thanks in advance for your time and patience.
    Archana

    Here's a start:
    public class FileModel5 extends AbstractTableModel
    public boolean isEditable = false;
    protected static int NUM_COLUMNS = 3;
    // initialize number of rows to start out with ...
    protected static int START_NUM_ROWS = 0;
    protected int nextEmptyRow = 0;
    protected int numRows = 0;
    static final public String file = "File";
    static final public String mailName = "Mail Id";
    static final public String postName = "Post Office Id";
    static final public String columnNames[] = {"File", "Mail Id", "Post Office Id"};
    // List of data
    protected Vector data = null;
    public FileModel5()
    data = new Vector();
    public boolean isCellEditable(int rowIndex, int columnIndex)
    // The 2nd & 3rd column or Value field is editable
    if(isEditable)
    if(columnIndex > 0)
    return true;
    return false;
    * JTable uses this method to determine the default renderer/
    * editor for each cell. If we didn't implement this method,
    * then the last column would contain text ("true"/"false"),
    * rather than a check box.
    public Class getColumnClass(int c)
    return getValueAt(0, c).getClass();
    * Retrieves number of columns
    public synchronized int getColumnCount()
    return NUM_COLUMNS;
    * Get a column name
    public String getColumnName(int col)
    return columnNames[col];
    * Retrieves number of records
    public synchronized int getRowCount()
    if (numRows < START_NUM_ROWS)
    return START_NUM_ROWS;
    else
    return numRows;
    * Returns cell information of a record at location row,column
    public synchronized Object getValueAt(int row, int column)
    try
    FileRecord5 p = (FileRecord5)data.elementAt(row);
    switch (column)
    case 0:
    return (String)p.file;
    case 1:
    return (String)p.mailName;
    case 2:
    return (String)p.postName;
    catch (Exception e)
    return "";
    public void setValueAt(Object aValue, int row, int column)
    FileRecord5 arow = (FileRecord5)data.elementAt(row);
    arow.setElementAt((String)aValue, column);
    fireTableCellUpdated(row, column);
    * Returns information of an entire record at location row
    public synchronized FileRecord5 getRecordAt(int row) throws Exception
    try
    return (FileRecord5)data.elementAt(row);
    catch (Exception e)
    throw new Exception("Record not found");
    * Used to add or update a record
    * @param tableRecord
    public synchronized void updateRecord(FileRecord5 tableRecord)
    String file = tableRecord.file;
    FileRecord5 p = null;
    int index = -1;
    boolean found = false;
    boolean addedRow = false;
    int i = 0;
    while (!found && (i < nextEmptyRow))
    p = (FileRecord5)data.elementAt(i);
    if (p.file.equals(file))
    found = true;
    index = i;
    } else
    i++;
    if (found)
    { //update
    data.setElementAt(tableRecord, index);
    else
    if (numRows <= nextEmptyRow)
    //add a row
    numRows++;
    addedRow = true;
    index = nextEmptyRow;
    data.addElement(tableRecord);
    //Notify listeners that the data changed.
    if (addedRow)
    nextEmptyRow++;
    fireTableRowsInserted(index, index);
    else
    fireTableRowsUpdated(index, index);
    * Used to delete a record
    public synchronized void deleteRecord(String file)
    FileRecord5 p = null;
    int index = -1;
    boolean found = false;
    int i = 0;
    while (!found && (i < nextEmptyRow))
    p = (FileRecord5)data.elementAt(i);
    if (p.file.equals(file))
    found = true;
    index = i;
    } else
    i++;
    if (found)
    data.removeElementAt(i);
    nextEmptyRow--;
    numRows--;
    fireTableRowsDeleted(START_NUM_ROWS, numRows);
    * Clears all records
    public synchronized void clear()
    int oldNumRows = numRows;
    numRows = START_NUM_ROWS;
    data.removeAllElements();
    nextEmptyRow = 0;
    if (oldNumRows > START_NUM_ROWS)
    fireTableRowsDeleted(START_NUM_ROWS, oldNumRows - 1);
    fireTableRowsUpdated(0, START_NUM_ROWS - 1);
    * Loads the values into the combo box within the table for mail id
    public void setUpMailColumn(JTable mapTable, ArrayList mailList)
    TableColumn col = mapTable.getColumnModel().getColumn(1);
    javax.swing.JComboBox comboMail = new javax.swing.JComboBox();
    int s = mailList.size();
    for(int i=0; i<s; i++)
    comboMail.addItem(mailList.get(i));
    col.setCellEditor(new DefaultCellEditor(comboMail));
    //Set up tool tips.
    DefaultTableCellRenderer renderer = new DefaultTableCellRenderer();
    renderer.setToolTipText("Click for mail Id list");
    col.setCellRenderer(renderer);
    //Set up tool tip for the mailName column header.
    TableCellRenderer headerRenderer = col.getHeaderRenderer();
    if (headerRenderer instanceof DefaultTableCellRenderer)
    ((DefaultTableCellRenderer)headerRenderer).setToolTipText(
    "Click the Mail Id to see a list of choices");
    * Loads the values into the combo box within the table for post office id
    public void setUpPostColumn(JTable mapTable, ArrayList postList)
    TableColumn col = mapTable.getColumnModel().getColumn(2);
    javax.swing.JComboBox combo = new javax.swing.JComboBox();
    int s = postList.size();
    for(int i=0; i<s; i++)
    combo.addItem(postList.get(i));
    col.setCellEditor(new DefaultCellEditor(combo));
    //Set up tool tips.
    DefaultTableCellRenderer renderer = new DefaultTableCellRenderer();
    renderer.setToolTipText("Click for post office Id list");
    col.setCellRenderer(renderer);
    //Set up tool tip for the mailName column header.
    TableCellRenderer headerRenderer = col.getHeaderRenderer();
    if (headerRenderer instanceof DefaultTableCellRenderer)
    ((DefaultTableCellRenderer)headerRenderer).setToolTipText(
    "Click the Post Office Id to see a list of choices");
    }

  • Problem in event handling of combo box in JTable cell

    Hi,
    I have a combo box as an editor for a column cells in JTable. I have a event listener for this combo box. When ever I click on the JTable cell whose editor is combo box,
    I get the following exception,
    Exception occurred during event dispatching:
    java.lang.NullPointerException
         at javax.swing.plaf.basic.BasicTableUI$MouseInputHandler.setDispatchComponent(Unknown Source)
         at javax.swing.plaf.basic.BasicTableUI$MouseInputHandler.mousePressed(Unknown Source)
         at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    Can any one tell me how to over come this problem.
    Thanks,
    Raghu

    Here's an example of the model I used in my JTable. I've placed 2 comboBoxes with no problems.
    Hope this helps.
    public class FileModel5 extends AbstractTableModel
    public boolean isEditable = false;
    protected static int NUM_COLUMNS = 3;
    // initialize number of rows to start out with ...
    protected static int START_NUM_ROWS = 0;
    protected int nextEmptyRow = 0;
    protected int numRows = 0;
    static final public String file = "File";
    static final public String mailName = "Mail Id";
    static final public String postName = "Post Office Id";
    static final public String columnNames[] = {"File", "Mail Id", "Post Office Id"};
    // List of data
    protected Vector data = null;
    public FileModel5()
    data = new Vector();
    public boolean isCellEditable(int rowIndex, int columnIndex)
    // The 2nd & 3rd column or Value field is editable
    if(isEditable)
    if(columnIndex > 0)
    return true;
    return false;
    * JTable uses this method to determine the default renderer/
    * editor for each cell. If we didn't implement this method,
    * then the last column would contain text ("true"/"false"),
    * rather than a check box.
    public Class getColumnClass(int c)
    return getValueAt(0, c).getClass();
    * Retrieves number of columns
    public synchronized int getColumnCount()
    return NUM_COLUMNS;
    * Get a column name
    public String getColumnName(int col)
    return columnNames[col];
    * Retrieves number of records
    public synchronized int getRowCount()
    if (numRows < START_NUM_ROWS)
    return START_NUM_ROWS;
    else
    return numRows;
    * Returns cell information of a record at location row,column
    public synchronized Object getValueAt(int row, int column)
    try
    FileRecord5 p = (FileRecord5)data.elementAt(row);
    switch (column)
    case 0:
    return (String)p.file;
    case 1:
    return (String)p.mailName;
    case 2:
    return (String)p.postName;
    catch (Exception e)
    return "";
    public void setValueAt(Object aValue, int row, int column)
    FileRecord5 arow = (FileRecord5)data.elementAt(row);
    arow.setElementAt((String)aValue, column);
    fireTableCellUpdated(row, column);
    * Returns information of an entire record at location row
    public synchronized FileRecord5 getRecordAt(int row) throws Exception
    try
    return (FileRecord5)data.elementAt(row);
    catch (Exception e)
    throw new Exception("Record not found");
    * Used to add or update a record
    * @param tableRecord
    public synchronized void updateRecord(FileRecord5 tableRecord)
    String file = tableRecord.file;
    FileRecord5 p = null;
    int index = -1;
    boolean found = false;
    boolean addedRow = false;
    int i = 0;
    while (!found && (i < nextEmptyRow))
    p = (FileRecord5)data.elementAt(i);
    if (p.file.equals(file))
    found = true;
    index = i;
    } else
    i++;
    if (found)
    { //update
    data.setElementAt(tableRecord, index);
    else
    if (numRows <= nextEmptyRow)
    //add a row
    numRows++;
    addedRow = true;
    index = nextEmptyRow;
    data.addElement(tableRecord);
    //Notify listeners that the data changed.
    if (addedRow)
    nextEmptyRow++;
    fireTableRowsInserted(index, index);
    else
    fireTableRowsUpdated(index, index);
    * Used to delete a record
    public synchronized void deleteRecord(String file)
    FileRecord5 p = null;
    int index = -1;
    boolean found = false;
    int i = 0;
    while (!found && (i < nextEmptyRow))
    p = (FileRecord5)data.elementAt(i);
    if (p.file.equals(file))
    found = true;
    index = i;
    } else
    i++;
    if (found)
    data.removeElementAt(i);
    nextEmptyRow--;
    numRows--;
    fireTableRowsDeleted(START_NUM_ROWS, numRows);
    * Clears all records
    public synchronized void clear()
    int oldNumRows = numRows;
    numRows = START_NUM_ROWS;
    data.removeAllElements();
    nextEmptyRow = 0;
    if (oldNumRows > START_NUM_ROWS)
    fireTableRowsDeleted(START_NUM_ROWS, oldNumRows - 1);
    fireTableRowsUpdated(0, START_NUM_ROWS - 1);
    * Loads the values into the combo box within the table for mail id
    public void setUpMailColumn(JTable mapTable, ArrayList mailList)
    TableColumn col = mapTable.getColumnModel().getColumn(1);
    javax.swing.JComboBox comboMail = new javax.swing.JComboBox();
    int s = mailList.size();
    for(int i=0; i<s; i++)
    comboMail.addItem(mailList.get(i));
    col.setCellEditor(new DefaultCellEditor(comboMail));
    //Set up tool tips.
    DefaultTableCellRenderer renderer = new DefaultTableCellRenderer();
    renderer.setToolTipText("Click for mail Id list");
    col.setCellRenderer(renderer);
    //Set up tool tip for the mailName column header.
    TableCellRenderer headerRenderer = col.getHeaderRenderer();
    if (headerRenderer instanceof DefaultTableCellRenderer)
    ((DefaultTableCellRenderer)headerRenderer).setToolTipText(
    "Click the Mail Id to see a list of choices");
    * Loads the values into the combo box within the table for post office id
    public void setUpPostColumn(JTable mapTable, ArrayList postList)
    TableColumn col = mapTable.getColumnModel().getColumn(2);
    javax.swing.JComboBox combo = new javax.swing.JComboBox();
    int s = postList.size();
    for(int i=0; i<s; i++)
    combo.addItem(postList.get(i));
    col.setCellEditor(new DefaultCellEditor(combo));
    //Set up tool tips.
    DefaultTableCellRenderer renderer = new DefaultTableCellRenderer();
    renderer.setToolTipText("Click for post office Id list");
    col.setCellRenderer(renderer);
    //Set up tool tip for the mailName column header.
    TableCellRenderer headerRenderer = col.getHeaderRenderer();
    if (headerRenderer instanceof DefaultTableCellRenderer)
    ((DefaultTableCellRenderer)headerRenderer).setToolTipText(
    "Click the Post Office Id to see a list of choices");
    }

  • Load Combo Box from MS Access

    Me and a co-worker are trying to learn the Designer for a proof of concept (yes, that means newbies). We are currently struggling with loading a dropdown combo box from a table in an MS Access database. We have the connection set up and the field assigned to the control. It populates with the first record from the table, but clicking on the dropdown button does nothing. Is it only populating with one record? Is there a property on the control that is not allowing the list to expand?
    I saw another thread in this forum on this topic and the last entry in the thread included the phrase "I GAVE UP" - not very encouraging. This functionality is a must-have and seems pretty basic.
    Any advice?

    I have been trying this using a Data Drop-down List and I cannot get it work. I have a data connection set up and instead of selecting Table from the choice I used an SQL query to select only one column in the table. There are three lines in the script some of which are confusing to me.<br /><br />var sDataConnectionName = "DataConnection"; //I got this one. it was easy<br />var sColHiddenValue = "<value>";<br />var sColDisplayText = "<value>";<br /><br />The last two I'm really not sure what to put there. I tried putting the name of the table column in place of each of "<value>". but it doesn't work.<br /><br />What else do I need to do to get it to work?

  • How to Bind a Combo Box so that it retrieves and display content corresponding to the Id in a link table and populates itself with the data in the main table?

    I am developing a desktop application in Wpf using MVVM and Entity Frameworks. I have the following tables:
    1. Party (PartyId, Name)
    2. Case (CaseId, CaseNo)
    3. Petitioner (CaseId, PartyId) ............. Link Table
    I am completely new to .Net and to begin with I download Microsoft's sample application and
    following the pattern I have been successful in creating several tabs. The problem started only when I wanted to implement many-to-many relationship. The sample application has not covered the scenario where there can be a any-to-many relationship. However
    with the help of MSDN forum I came to know about a link table and managed to solve entity framework issues pertaining to many-to-many relationship. Here is the screenshot of my application to show you what I have achieved so far.
    And now the problem I want the forum to address is how to bind a combo box so that it retrieves Party.Name for the corresponding PartyId in the Link Table and also I want to populate it with Party.Name so that
    users can choose one from the dropdown list to add or edit the petitioner.

    Hello Barry,
    Thanks a lot for responding to my query. As I am completely new to .Net and following the pattern of Microsoft's Employee Tracker sample it seems difficult to clearly understand the concept and implement it in a scenario which is different than what is in
    the sample available at the link you supplied.
    To get the idea of the thing here is my code behind of a view vBoxPetitioner:
    <UserControl x:Class="CCIS.View.Case.vBoxPetitioner"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:v="clr-namespace:CCIS.View.Case"
    xmlns:vm="clr-namespace:CCIS.ViewModel.Case"
    mc:Ignorable="d"
    d:DesignWidth="300"
    d:DesignHeight="200">
    <UserControl.Resources>
    <DataTemplate DataType="{x:Type vm:vmPetitioner}">
    <v:vPetitioner Margin="0,2,0,0" />
    </DataTemplate>
    </UserControl.Resources>
    <Grid>
    <HeaderedContentControl>
    <HeaderedContentControl.Header>
    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
    <TextBlock Margin="2">
    <Hyperlink Command="{Binding Path=AddPetitionerCommand}">Add Petitioner</Hyperlink>
    | <Hyperlink Command="{Binding Path=DeletePetitionerCommand}">Delete</Hyperlink>
    </TextBlock>
    </StackPanel>
    </HeaderedContentControl.Header>
    <ListBox BorderThickness="0" SelectedItem="{Binding Path=CurrentPetitioner, Mode=TwoWay}" ItemsSource="{Binding Path=tblParties}" />
    </HeaderedContentControl>
    </Grid>
    </UserControl>
    This part is working fine as it loads another view that is vPetioner perfectly in the manner I want it to be.
    Here is the code of vmPetitioner, a ViewModel:
    Imports Microsoft.VisualBasic
    Imports System.Collections.ObjectModel
    Imports System
    Imports CCIS.Model.Party
    Namespace CCIS.ViewModel.Case
    ''' <summary>
    ''' ViewModel of an individual Email
    ''' </summary>
    Public Class vmPetitioner
    Inherits vmParty
    ''' <summary>
    ''' The Email object backing this ViewModel
    ''' </summary>
    Private petitioner As tblParty
    ''' <summary>
    ''' Initializes a new instance of the EmailViewModel class.
    ''' </summary>
    ''' <param name="detail">The underlying Email this ViewModel is to be based on</param>
    Public Sub New(ByVal detail As tblParty)
    If detail Is Nothing Then
    Throw New ArgumentNullException("detail")
    End If
    Me.petitioner = detail
    End Sub
    ''' <summary>
    ''' Gets the underlying Email this ViewModel is based on
    ''' </summary>
    Public Overrides ReadOnly Property Model() As tblParty
    Get
    Return Me.petitioner
    End Get
    End Property
    ''' <summary>
    ''' Gets or sets the actual email address
    ''' </summary>
    Public Property fldPartyId() As String
    Get
    Return Me.petitioner.fldPartyId
    End Get
    Set(ByVal value As String)
    Me.petitioner.fldPartyId = value
    Me.OnPropertyChanged("fldPartyId")
    End Set
    End Property
    End Class
    End Namespace
    And below is the ViewMode vmParty which vmPetitioner Inherits:
    Imports Microsoft.VisualBasic
    Imports System
    Imports System.Collections.Generic
    Imports CCIS.Model.Case
    Imports CCIS.Model.Party
    Imports CCIS.ViewModel.Helpers
    Namespace CCIS.ViewModel.Case
    ''' <summary>
    ''' Common functionality for ViewModels of an individual ContactDetail
    ''' </summary>
    Public MustInherit Class vmParty
    Inherits ViewModelBase
    ''' <summary>
    ''' Gets the underlying ContactDetail this ViewModel is based on
    ''' </summary>
    Public MustOverride ReadOnly Property Model() As tblParty
    '''' <summary>
    '''' Gets the underlying ContactDetail this ViewModel is based on
    '''' </summary>
    'Public MustOverride ReadOnly Property Model() As tblAdvocate
    ''' <summary>
    ''' Gets or sets the name of this department
    ''' </summary>
    Public Property fldName() As String
    Get
    Return Me.Model.fldName
    End Get
    Set(ByVal value As String)
    Me.Model.fldName = value
    Me.OnPropertyChanged("fldName")
    End Set
    End Property
    ''' <summary>
    ''' Constructs a view model to represent the supplied ContactDetail
    ''' </summary>
    ''' <param name="detail">The detail to build a ViewModel for</param>
    ''' <returns>The constructed ViewModel, null if one can't be built</returns>
    Public Shared Function BuildViewModel(ByVal detail As tblParty) As vmParty
    If detail Is Nothing Then
    Throw New ArgumentNullException("detail")
    End If
    Dim e As tblParty = TryCast(detail, tblParty)
    If e IsNot Nothing Then
    Return New vmPetitioner(e)
    End If
    Return Nothing
    End Function
    End Class
    End Namespace
    And final the code behind of the view vPetitioner:
    <UserControl x:Class="CCIS.View.Case.vPetitioner"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:vm="clr-namespace:CCIS.ViewModel.Case"
    mc:Ignorable="d"
    Width="300">
    <UserControl.Resources>
    <ResourceDictionary Source=".\CompactFormStyles.xaml" />
    </UserControl.Resources>
    <Grid>
    <Border Style="{StaticResource DetailBorder}">
    <Grid>
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="Auto" />
    <ColumnDefinition Width="*" />
    </Grid.ColumnDefinitions>
    <TextBlock Grid.Column="0" Text="Petitioner:" />
    <ComboBox Grid.Column="1" Width="240" SelectedValuePath="." SelectedItem="{Binding Path=tblParty}" ItemsSource="{Binding Path=PetitionerLookup}" DisplayMemberPath="fldName" />
    </Grid>
    </Border>
    </Grid>
    </UserControl>
    The problem, presumably, seems to be is that the binding path "PetitionerLookup" of the ItemSource of the Combo box in the view vPetitioner exists in a different ViewModel vmCase which serves as an ObservableCollection for MainViewModel. Therefore,
    what I need to Know is how to route the binding path if it exists in a different ViewModel?
    Sir, I look forward to your early reply bringing a workable solution to the problem I face. 
    Warm Regards,
    Arun

  • Analyzer 6.5: Linking Table to a combo box

    I created a combo box containing all month from January to December.If the user select for example December, he should get on the report the actual month (=December) and the privious month (=November).How can I do this with analyzer?Additional question: How can I solve this problem when the user select January and he should get January and December on the report?Help is very appreciated.

    Depending on how your outline is set up, there are a few different ways you can do this.For starters if you only need to see current month and previous month, then you might want to look at using substitution variables.Assuming you are not looking to use substituion variables because you are looking to give your users a solution that allows them to go back more than one month, you might want to try something like the following. (It might seem a bit long, but since you are dealing with the time dimension and would only need to repeat the process once for each month, it shouldn't take too long to put it in place.)Here's what you can do:When selecting members for your combo box, you should select the top member of you Time Dimension, for instance 'Year Tot'.Once 'Year Tot' shows on the right side of the selection list, you can right click on it and a menu will come up asking if you also want to include children, descendents, etc.; choose at the bottom of the list "Select Subset". Once there, you want to choose from the drop down, 'Expression Contained is', and type the member name 'Nov', (click the add button), then choose 'Expression Contained is' and type the member name 'Dec' (click the add button). Now go to the advanced button and change your connector from 'And' to 'Or'. Click okay.(Basically you are creating a subset that will return November Or December)You now have a member added to your drop down box called "Year Tot" (or whatever you time dim member name is) Rename 'Year Tot' to "Dec" and click okay. You now have a member in your drop down list called 'Dec' that really represents a subset which includes both Nov and Dec. When users click on Dec in the combo box they will see Nov and Dec in the grid.You would then repeat these steps for each month.As far as January showing The current year January and the previous year December, that can be a little tricky. I'm assuming your time dimsnsion is NOT set up as a fiscal year cross over model and instead you have one dimension with your months and then a scenario type dimension with your years. One solution is to add a 13th month to your month's dimension that does not consolidate. The 13th month can be named 'Prior Yr Dec' You would then write a calc script in Essbase to copy your Dec numbers to Prior Yr Dec. (ie "Prior Yr Dec"->2004 = Dec->2003)Once you have this done, you could easily implement the steps above and achieve the results you are looking for.Best Regards,

  • How can I code a lookup table from a combo box

    Hi, I am trying to use combo boxes on a front page which selects a desired gas.  I then want this to look up a simple 2D table which returns the associated K factor value to be used.  Essentially I need to gain the conversion factor for a selected gas to be used in the block diagram to adjust the outputs and inputs accordingly.  I tried to load an excel file into an array and then extract the desired numeric value but failed. Any help would be great.  I don’t want to be manually inputting the values in the block diagram because there are lots of them so it must be read in from a file of some sort.
    Regards

    Hello Sniepsy,
    You posted this question in the FieldPoint forum, but the
    question appears to have nothing to do with that hardware product.  I can’t deduce from your post what
    programming platform you are using, but I assume that it’s LabVIEW.  If so, you might consider reposting your
    question to the LabVIEW forum.
    I’ll broadly address your question though.  If the number of possible input factors is
    small (say in the order of less than 50), the easiest thing to do is just
    generate 2 1D arrays with one for keys, and one for values.  Make sure the indices match up and just look
    up the index of a key in array 1, and index array 2 with that to get your
    number.  A purist might complain that the
    lookup time would be linear, and we can achieve log-time with sorted lists and
    advanced structures – but since these aren’t in LabVIEW the overhead of
    implementing them might outweigh the benefit.
    Hope this helps! 
    Please let us know if you have further questions.
    Travis M
    LabVIEW R&D
    National Instruments

  • Access 2010 - How to display data from a table into a text box upon combo box selection?

    Hi
    I have a a table with 5 columns: month, year, USD, SGD, BAHT.
    I created a form with a combo box for selection of the month and year, and I would like to set adjacent text boxes to show USD, SGD, BAHT information. How can i go about doing that?
    From the Q&A here, most of them uses the function similar to this "=[Combo0].[Column](1)" to show the data in the text box, but this would require the combo box to list a whole bunch of details if i were to add in more currency values to the
    table. Is it possible to not show this information in the combo box, but still populate data in the textboxes base on a selection on only the "month" and "year" in the combo box.

    Hi,
    According to your description, my understanding is that you want to show only the month/year in the combo box, we can choose the date, and it will display the value of USD/SGD/BAHT based on the month/year.
    If it is, I recommend you try the steps:
    Create a form based on your data source table>Add the combo box>combo box wizard>Find a record on my form based on the value I selected my combo box>Add mouth and year to selected fields
    http://office.microsoft.com/en-us/access-help/create-a-list-of-choices-by-using-a-list-box-or-combo-box-HA010113052.aspx
    If I misunderstand something, please let me know. We may upload some screenshots or a sample through OneDrive.
    Regards,
    George Zhao
    TechNet Community Support

Maybe you are looking for

  • Mac 10.5.4 update

    Don't know if this is specific to LR 2.0 only or not, but when I switch Spaces, then click on LR in the dock, the dock goes away, but LR is not switched back in. So far, this is the only thing amiss with the 10.5.4 update. Too early to tell. Worst ca

  • Is MathScript what I need?

    My algorithm involves the following vectory mathematics: (1) Define two vectors. (2) Cross product the two vectors to create a normal vector. (3) Add three vectors. (You get the general content of the program) The data that MathScript will use will b

  • Forms and ipad

    I created a fill-in form in LC in adobe 8 using one of the provided templates. It has drop down lists, date fields and 1 sub-total field for user entered expenditures. When I export it to an Ipad, the drop downs function perfectly, but the date field

  • Why does 404 error show when I try to enter the mail on Yahoo

    after having HUGE problems with the 'babylon translator' program; it added itself as a search/toolbar not only on Firefox, but IE and Google Chrome, without my invite. After having to delete ALL of these browsers, add-ons and plug-ins associated with

  • Trace or debug the IP module

    Hi, I develop a ethernet device driver with streams and dlpi. I don't know when I send a message upstream which module will receive this message. Is there any possibility to trace or debug a streams connection between a ethernet device-module an the