JTable - Select entire Row

Hi
How is it possible to select the entire row of a JTable without the cell that`s selected, gaining a border.
Any help would be appreciated.
Thanks
Kelly

Could you explain what you need? You don't want the border of the selected row to be displayed?

Similar Messages

  • JTable selecting a row....

    I have tried many things to figure out how to select a row using jTable. Nothing works for me, can someone please help. Here are some samples of what I have tried. If you need more information please ask and I will post it immediately. Thanks
    Attempt #1
    void jTable1_mouseClicked(MouseEvent e) {
    ListSelectionModel lm = jTable1.getSelectionModel();
    int selectedRow1 = lm.getMinSelectionIndex();
    if ((e.getModifiers() & InputEvent.BUTTON1_MASK)!=0) {
    int row = jTable1.getSelectedRow();
    jTable1.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    Attempt #2
    void jButtonSelect_actionPerformed(ActionEvent e) {
    jTable1.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    ListSelectionModel lm = jTable1.getSelectionModel();
    int selectedRow1 = lm.getMinSelectionIndex();
    if ((e.getModifiers() & InputEvent.BUTTON1_MASK)!=0) {
    int row = jTable1.getSelectedRow();
    ListSelectionModel rowSM = jTable1.getSelectionModel();
    rowSM.addListSelectionListener (new ListSelectionListener() {
    public void valueChanged (ListSelectionEvent e) {
    if (e.getValueIsAdjusting ()) return;
    ListSelectionModel lsm = (ListSelectionModel ) e.getSource();
    if(lsm.isSelectionEmpty()){
    System.out.println("No rows are selected.");
    else{
    int selectedRow = lsm.getMinSelectionIndex();
    System.out.println("Row "+selectedRow+" is now selected.");
    Thank you once again :0)

    Why do you want to know when a row is selected?
    If you are just trying to edit data you are going about this the hard way. Just use the table model.
    If you want to have some other action occur when a row is selected try something like this.
    table.addMouseListener (new MouseAdapter()
    public void mouseClicked (MouseEvent e)
    Point origin = e.getPoint();
    if ( e.getClickCount() == 2)
    { // double clicked
    int row = table.rowAtPoint(origin);
    if (row == -1)
    return;
    else
    // Do something
    else
    // single click
    int row = tabl.rowAtPoint (origin);
    if (row > -1)
    // Do something else

  • Selecting entire row into instance of jpub class gives error

    Hi. I'm using oracle 9i. I used JPublisher to create classes for my db objects, and now I want to execute:
    select value(u) from university_tb where u.name = 'Harvard';
    where university_tb is a table of university_t. I want to have the row returned into an instance of my java university_t class. So I create an instance of university_t and then say:
    ResultSet rs = stmt.executeQuery("select value(u) from University_tb u");
    rs.next();
    uniInstance = ((university_t)rs.getObject(1));
    I get an error which I traced to the casting of the returned object into a university_t. JPub classes use the readSQL() method to handle casting of an object. That's where my error occurs.
    public void readSQL(SQLInput stream, String type)
    throws SQLException
    super.readSQL(stream, type);
    setDescription(stream.readString());
    setAddress((AddressT) stream.readObject()); <-- IT OCCURS RIGHT HERE
    setYearfoundation(stream.readString());
    setContactinfo((ContactinfoT) stream.readObject()); <-- IF I REMOVE THE LINE ABOVE IT OCCURS RIGHT HERE INSTEAD
    setPresident(stream.readRef());
    setFaculties(stream.readArray());
    So it can be seen that in both cases it happens when trying to read a non-primitive type. Has anyone heard of any problems/solution with the readSQL() method of jpublisher classes, when there is a non-primitve, user defined type? My schema definitions follow. Any advice would be appreciated. Thanks.
    create or replace type Address_t as object
    ( Num int,
    Street varchar2(100),
    City varchar2(50),
    Province varchar2(50),
    Country varchar2(50),
    Postcode varchar2(15));     
    create type contactinfo_t as object (
    phone varchar2(20),
    fax varchar2(20),
    email varchar2(35));
    create type unit_t as object (
    name varchar2(200)) not final;
    create or replace type University_t under unit_t
         Description varchar2(1000),
         Address Address_t,
         YearFoundation varchar2(10),
         ContactInfo ContactInfo_t,
         President ref Person_t,
         Faculties AcademicUnit_nt);

    Hi Saro,
    DBMS_STATS.AUTO_SAMPLE_SIZE is a DB setting set for the Estimate Percentage.
    We can know the value currently set by using below SQL.
    SQL> select dbms_stats.get_prefs('ESTIMATE_PERCENT','DACREP','W_ETL_RUN_S') from dual;
    assuming DACREP is the owner of the DAC Repository. If the value is not set please set it by below SQL. The 2 in sql is variable you can size it optimal.
    SQL> exec dbms_stats.set_database_prefs('ESTIMATE_PERCENT',2);
    Regards,
    Jay

  • JTable Selecting Column/Row

    import javax.swing.DefaultCellEditor;
    import javax.swing.JComboBox;
    import javax.swing.JTextField;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.table.AbstractTableModel;
    import javax.swing.table.DefaultTableCellRenderer;
    import javax.swing.table.TableCellRenderer;
    import javax.swing.table.TableColumn;
    import java.awt.Component;
    import java.awt.Dimension;
    import java.awt.GridLayout;
    public class TableDemo extends JPanel {
        private boolean DEBUG = false;
        public TableDemo() {
             super(new GridLayout(1,0));
             JTable table = new JTable(new MyTableModel());
             table.setPreferredScrollableViewportSize(new Dimension(500, 70));
             JScrollPane scrollPane = new JScrollPane(table); //Set up column sizes.
             initColumnSizes(table); //Fiddle with the Sport column's cell editors/renderers.
             setUpSportColumn(table, table.getColumnModel().getColumn(2)); //Add the scroll pane to this panel.
             add(scrollPane);
        private void initColumnSizes(JTable table) {
             MyTableModel model = (MyTableModel)table.getModel();
             TableColumn column = null;
             Component comp = null;
             int headerWidth = 0;
             int cellWidth = 0;
             Object[] longValues = model.longValues;
             TableCellRenderer headerRenderer = table.getTableHeader().getDefaultRenderer();
             for (int i = 0; i < 3; i++) {
             column = table.getColumnModel().getColumn(i);
             comp = headerRenderer.getTableCellRendererComponent( null, column.getHeaderValue(), false, false, 0, 0);
             headerWidth = comp.getPreferredSize().width;
             comp = table.getDefaultRenderer(model.getColumnClass(i)). getTableCellRendererComponent( table, longValues, false, false, 0, i);
         cellWidth = comp.getPreferredSize().width;
         if (DEBUG) {
         System.out.println("Initializing width of column " + i + ". " + "headerWidth = " + headerWidth + "; cellWidth = " + cellWidth);
         column.setPreferredWidth(Math.max(headerWidth, cellWidth));
    public void setUpSportColumn(JTable table, TableColumn sportColumn) {
         JComboBox comboBox = new JComboBox();
         comboBox.addItem("SnowBoarding");
         comboBox.addItem("Rowing");
         comboBox.addItem("Knitting");
         comboBox.addItem("Speed reading");
         comboBox.addItem("Pool");
         comboBox.addItem("None of the above");
         sportColumn.setCellEditor(new DefaultCellEditor(comboBox));
         DefaultTableCellRenderer renderer = new DefaultTableCellRenderer();
         renderer.setToolTipText("Click for combo box");
         sportColumn.setCellRenderer(renderer);
    class MyTableModel extends AbstractTableModel {
         private String[] columnNames = {"First Name", "Last Name", "Sport", "# of Years", "Vegetarian"};
         private Object[][] data = { {"Mary", "Campione", "Snowboarding", new Integer(5), new Boolean(false)}, {"Alison", "Huml", "Rowing", new Integer(3), new Boolean(true)}, {"Kathy", "Walrath", "Knitting", new Integer(2), new Boolean(false)}, {"Sharon", "Zakhour", "Speed reading", new Integer(20), new Boolean(true)}, {"Philip", "Milne", "Pool", new Integer(10), new Boolean(false)} };
         public final Object[] longValues = {"Sharon", "Campione", "None of the above", new Integer(20), Boolean.TRUE};
         public int getColumnCount() {
                   return columnNames.length;
    public int getRowCount() {
         return data.length;
    public String getColumnName(int col) {
         return columnNames[col];
    public Object getValueAt(int row, int col) {
         return data[row][col];
    public Class getColumnClass(int c) {
         return getValueAt(0, c).getClass();
    public boolean isCellEditable(int row, int col) {
         if (col < 2) {
         return false;
    else {
    return true;
    public void setValueAt(Object value, int row, int col) {
         if (DEBUG) {
    System.out.println("Setting value at " + row + "," + col + " to " + value + " (an instance of " + value.getClass() + ")");
         data[row][col] = value; fireTableCellUpdated(row, col);
         if (DEBUG) {
         System.out.println("New value of data:");
         printDebugData();
    private void printDebugData() {
         int numRows = getRowCount();
         int numCols = getColumnCount();
         for (int i=0; i < numRows; i++) {
         System.out.print(" row " + i + ":");
         for (int j=0; j < numCols; j++) {
              System.out.print(" " + data[i][j]);
         System.out.println();
         } System.out.println("--------------------------");
    private static void createAndShowGUI() {
    JFrame.setDefaultLookAndFeelDecorated(true);
    JFrame frame = new JFrame("TableDemo");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    TableDemo newContentPane = new TableDemo();
    newContentPane.setOpaque(true);
    frame.setContentPane(newContentPane);
    frame.pack();
    frame.setVisible(true);
    public static void main(String[] args) {
         javax.swing.SwingUtilities.invokeLater(new Runnable() {
         public void run() { createAndShowGUI();
    According to this Application the rendering and cell editing is done based on the column. And it displays the same column values for each row.
    I want to use the same application but want to change the[b] set of column values for each row.
    ex:
                    [u] Column values[/u]
    Row 0 =  { Snowboarding ,Rowing, Knitting.......}
    Row 2 = {  A,B,C,..........}
    Row 3 = {1,2,3}
    Help PLEASE!!!!
    thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    This posting shows one way:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=446022

  • JTable-Selecting a row when i press an alphabet in a single column table

    hi,
    I have come across a issue where if i press a alphabet the row containig the leading alphabet should be selected.
    for eg: if i press "s" the first occurence of row containing string starting with "s" ie "stateful" sholud be selected.My table has 1 column only..
    please look in to it nad provide a solution.
    Looking fwd
    cheers,
    sharath

    Use a JList. It supports this functionality.
    Otherwise you would need to add a KeyListener to the table. Loop through the model using getValueAt(...) and compare the first character and then highlight the line.

  • JTable: Selecting rows in columns independently

    Dear all,
    I have a JTable with two columns. I want the user to be able to select cells in columns independently. At present, the entire row gets marked as selected. Is it possible at all to, for instance, select row1 1 to 3 in column 1 and rows 4 to 5 in column 2? If so, where's the switch? Thanks a lot in advance!
    Cheers,
    Martin

    Are you trying to use a seperate table for each column.
    Thats not a good idear.
    Here is what you have to do.
    1. Create a sub class of JTable
    2. You will have to redefine how the selection is done so. You will need some sort of a collection to store the list of selected cells indexes
    2.1 Selecting a cell is simply adding the coordinations of the cell to the selection
    2.2 de selecting is just removing it from the collection.
    2.3 Here is what you have to override
         setColumnSelectionInterval()
         setColumnSelectionInterval()
         changeSelection()
         selectAll()
         getSelectedColumns()
         getSelectedColumn()
         getSelectedRows()
         getSelectedRow() You migh also need few new methods such as
         setCellSelected(int row, int column, boolean selected);
         boolean isCellSelected(int row, int column);
         clearSelection();
         int[][] getSelectedCells();You will have to implement the above in terms of your new data structure.
    3. Handle mouse events.
    Ex:- when user cicks on a cell if it is already selected it should be deselected (see 2.2)
    other wise current selected should be cleared and the clicked cell should be selected
    if your has pressed CTRL key while clicking the the cell should be selected without deselecting the old selection.
    ---you can use above using a MouseListener
    When the user hold down a button and move the mouse accross multiple cell those need to be selected.
    --- You will need a MouseMotionListener for this
    You might also need to allow selection using key bord. You can do that using a KeyListener
    4. Displaying the selection
    You have to make sure only the selected cells are high lighted on the table.
    You can do this using a simple trick.
    (Just override getCellEditor(int row, int column) and getCellRenderer(int row, int column) )
    Here is what you should do in getCellRenderer(int row, int column)
    public TableCellRenderer getCellRenderer(int row, int column)
      TableCellRenderer realRenderer = super.getCellRenderer(int row, int);
      return new WrapperRenderer(realRenderer,selectedCellsCollection.isCellSelected(row,column));
    static class WrapperRenderer implements TableCellRenderer{
        TableCellRenderer realRenderer;
        boolean selected;
        public WrapperRenderer(TableCellRenderer realRenderer, boolean selected){
           this.realRenderer = realRenderer;
           this.selected = selected;
        public Component getTableCellRendererComponent(JTable table,
                                                   Object value,
                                                   boolean isSelected,
                                                   boolean hasFocus,
                                                   int row,
                                                   int column){       
            return realRenderer.getTableCellRendererComponent(table,value,selected,hasFocus,row,column);
    }What the above code does is it simply created wrapper for the Renderer and when generating the rendering component it replaces the isSeleted flag with our on selected flag
    and the original renderer taken from the super class will do the rest.
    You will have to do the same with the TableCellEditor.
    By the way dont use above code as it is becouse the getCellRenderer method create a new instance of WrapperRenderer every time.
    If the table has 10000 cells above will create 10000 instances. So you should refine above code.
    5. Finnaly.
    Every time the selection is changes you should make the table rerender the respective cells in or der to make the changes visible.
    I'll leave that part for you to figure out.
    A Final word
    When implementing th above make sure that you do it in the java way of doing it.
    For the collection of selected cells write following classes
    TableCellSelectionModel  // and interface which define what it does
    DefaultTableCellSelectionModel //Your own implementation of above interface the table you create should use thisby default
    //To communicate the selection changes
    TableCellSelectionModelListener
    TableCellSelectionModelEventif you read the javadoc about similer classes in ListSelectionModel you will get an idear
    But dont make it as complex as ListSelectionModel try to keep the number of methods less than 5.
    If you want to make it completly genaric you will have to resolve some issues such as handling changes to the table model.
    Ex:- Rows and colums can be added and removed in the TableModle at the run time as a result the row and column indexes of some cells might change
    and the TableCellSelectionModel should be updated with those changes.
    Even though the todo list is quite long if you plan your implementation properly the code will not be that long.
    And more importantly you will learn lots more by trying to implementing this.
    Happy Coding :)

  • How do you set the font color for a specific entire row inside a JTable?

    How do you set the font color for a specific entire row inside a JTable?
    I want to change the font color for only a couple of rows inside a JTable.
    I've seen some ways to possibly do this with an individual cell.
    Clarification on changing the font color in an individual cell would be helpful too if
    there is no easy way to do this for a row.

    hai,
    Try out with this piece of code.Create your table and assign the renderer to each column in the table.
    CellColorRenderer m_CellColorRenderer = new CellColorRenderer();
    for(int i=0;i<your_JTable.getColumnCount();i++)
    your_JTable.getColumnModel().getColumn(i).setCellRenderer(m_CellColorRenderer);
    class CellColorRenderer extends JLabel implements TableCellRenderer
    CellColorRenderer()     
    setOpaque(true);     
    setHorizontalAlignment(LEFT);
    setVerticalAlignment(CENTER);
    setBackground(Color.white);
    setForeground(Color.black);
    protected void setValue(Object value)
         setText((value == null) ? "" : value.toString());
    public Component getTableCellRendererComponent(JTable table,Object value,boolean isSelected, boolean hasFocus, int row,int column)
         if(isSelected == true)
              setForeground(Color.red);
         else
              setForeground(Color.black);
         setValue(value);
         return this;
    regards,
    bala

  • Selecting an entire row with the help of Checkbox

    Hi and Evening to Everybody,
    I have a Scenario where i need to select an entire row using the check box. Let me first define the Situation. I created a Simple Sql-report where the first column is a Simple Checkbox and the second column is a display only name and followed by the rest 5 columns as a checkbox.
    my table structure is :
    **create table satt (SELECT_ALL VARCHAR2(10), Name VARCHAR2(50), Object1 VARCHAR2(10), Object2 VARCHAR2(10), Object3 VARCHAR2(10), Object4 VARCHAR2(10), Object5 VARCHAR2(10));**
    Now i had a requirement where i need to Check All or Uncheck All Checkbox by clicking SELECT_ALL column header and i made it using
    simple java-script :
    "<input type="Checkbox" onclick="$f_CheckFirstColumn(this)">"
    Now i need to Check all checkbox in a row by clicking any of the SELECT_ALL check boxes. (Say i have 5 checkboxes in SELECT_ALL column and if i click 3rd checkbox... i need the entire 3rd row checkbox to be checked on click of that 3rd check box).
    I hope i was clear with my question. i did my best. Please help me out with this... Im eagerly lookin for the solutions.
    Thanks & Regards,
    - The Beginner.
    Edited by: 854477 on Jul 13, 2011 4:57 AM
    Edited by: 854477 on Jul 13, 2011 5:01 AM

    Solomon Yakobson wrote:
    There is no row order in relational tables unless ORDER BY is used, so there is no way to decide if 3 Mathematics belongs to 100 or to 200.
    SY.That's not how I interpretted it. I thought he was saying that in the first row column B has the value:
    '1 Physics'||chr(10)||'2 Chemistry'||chr(10)||'3 Mathematics'
    in which case something like this would work
    select a,replace(b,chr(10),chr(10)||a||' ') from table;

  • How to select a row in Jtable at runtime

    how to select a row in Jtable at runtime.

    use
    setRowSelectionInterval(int fromRowIndex, int toRowIndex);example if your table has 10 rows then u want to select the rows from 4 to 8 then use
    setRowSelectionInterval(3, 7);if you want to select just one row for example 5 then use
    setRowSelectionInterval(5, 5);

  • Jtable: How to change the color of an entire row?

    How can I change the color on an entire row in a Jtable based upon the value in one of the cells in that row.
    For example: Lets say:
    I have 5 rows. Each row has 4 columns.
    If column 4 has a value "A" in any of the rows, all the text in that row should be red.
    If column 4 has a value "B" in any of the rows, all the text in that row should be blue.
    Just point me in the right direction and I will try to take it on from there.
    Thanks

    In the future, Swing related questions should be posted in the Swing forum.
    But there is no need to repost because you can search the Swing forum for my "Table Prepare Renderer" (without the spaces) example which shows how this can be done.
    But first read the tutorial link given above.

  • JTable select row by double click, single click

    Hi all,
    I would like to double click on the row of the JTable and pop up a window for adding stuff, a single click for selecting the row and then in the menu bar I can choose to etither add, change or delete stuff. I try to use the ListSelectionModel but does not seems to distinguish between double or single click.
    Any idea, doc, samples?
    or I should not use ListselectionModel at all?
    thanks
    andrew

    Hi. I used an inner class. By using MouseAdapter u dont have to implement all methods in the interface..
    MouseListener mouseListener = new MouseAdapter()
    public void mouseClicked(MouseEvent e)
    if(SwingUtilities.isLeftMouseButton(e))// if left mouse button
    if (e.getClickCount() == 2) // if doubleclick
    //do something
    U also need to add mouselistener to the table:
    table.addMouseListener(mouseListener);
    As I said, this is how I did it.. There are probably alot of ways to solve this, as usual :). Hope it helps

  • Select whole row in a JTable

    I would like to know how I can fix so that when a user clicks a cell in my JTable the whole row gets selected. Not with the clicked cell as white and the rest of the row in blue, but with the whole row in blue. I would also like to stop the cell from beeing edited. The third thing I wonder is how I can hide the grid between the cells, and make it look like a list??
    Thanks for replies!

    Thanks for the help!
    I managed to get the frame around the selected cell also. Did it by extending the DefaultTableCellRenderer. Found some more help here:
    http://forum.java.sun.com/thread.jsp?thread=447758&forum=57&message=2028189

  • How to select a row in JTable for right mouse click ?

    Hi All,
    I need to select a row on JTable for right mouse click ?
    Can any one help me ?
    Thanks a lot.
    Seelam.

    Got solution...
    tabel.addRowSelectionInterval(..) works.
    thanks.

  • How to select a row in JTable

    Hello,
    I have a problem selecting a row in a JTable.
    I use
    mytable.getSelectionModel().setSelectionInterval(row, row);
    to select a row, but after that this row is only highlighted. After calling this method I cannot change the selection using the arrow keys.
    Can anybody give me a hint, how I can get the row selected, so that I can use the arrow keys immediately after selecting the row?
    Any help is welcome.
    Thanks,
    Fritz

    Hello,
    I got the solution:
    final int pRow = row;
    final int pCol = column;
    final JTable myTable = mytable;
    SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    myTable.requestFocusInWindow();
    myTable.changeSelection(pRow, pCol, true, true);

  • Select multiple rows on a JTable

    Hi!
    Given: JTable, multiple selection allowed
    Wanted: a way to be able to set multiple non-continuous rows selected
    eg. on a JTable with 5 rows,
    I want to set rows 1, 3 and 5 selected
    Anyone?
    Stoffel.

    table.setSelectionMode(ListSelectionModel.MULTIPLE_INTE
    VAL_SELECTION);
    select rows using <ctrl> and/or <shift>Or if you want to set programaticly use this methods, see the api
    for explanation.
    table.changeSelecton(int row, int column, boolean toogle, boolean extend);
    table.addRowSelection(int index0, int index1);
    table.addColumnSelectionInterval(int index0, int index1)
    ...

Maybe you are looking for

  • Different color text in one cell

    How do I set a color for a group of words within a cell leaving the rest of the words black? I can make all the text within a cell the same color but when I select the words I want to be a different color the color selector in the toolbar goes away a

  • JMS automatic Service migration - need to re-deploy ?

    Hi We re-configured the settings to use weblogic 10.3's automatic JMS service migration. (Exactly once type)(DB lease) Even though the migration happened successfully from a managed server to another, application had to be manually redeployed (throug

  • Videos not playing anymore...

    Hi, here's my problem. DRM'ed Videos (or basically any video bought on iTunes Store) doesn't play anymore for some reason. Though, videos downloaded from YouTube or my personnal videos still play. I'm guessing codec or DRM problem on my machine becau

  • My iphone did't connect to itunes ?

    i want a help me to connect my iphone to my itunes ..

  • Enabling the sip/alg

    Hi  I am looking to use a softphone from a third party software and for that  I have just purchased a new BT Home Hub 3 in the hope that it would work (I had BT Home Hub 2 and was told to buy the Home Hub 3) but unfortunately it doesn't. I was told t