Please help me..about JTable ..Please please

I have a JTable and tried to set the width for its columns..but I dont
know why it doesnt work..here's my codes:
Please help me..thanks..
import javax.swing.table.TableColumn;
import javax.swing.table.*;
JTable table = new JTable();
//a method{
DefaultTableModel model = new DefaultTableModel(rowData, columnNames) {
public boolean isCellEditable(int row, int col){   return false; }
table.setModel(model);
TableColumn column = tblEntryList.getColumnModel().getColumn(0);
column.setPreferredWidth(25);
column = tblEntryList.getColumnModel().getColumn(1);
column.setPreferredWidth(100);

I did feed the data into the table..you can tell by looking at my codes..
please show me..dont know why it doesnt work.
I just have my tlbEntrylist declared as
String[][] rowData = new String[0][];
String[] columnNames = {"Cnt","Name","Text"};
JTable tblEntryList = new JTable(rowData, columnNames);
//then whenever I click a a button , will call loadTableEntries()
to remove all row data and refresh with new data..so I have to
set new new model for this table.
private void loadTableEntries()
tblEntryList.removeAll(); // Remove old entries
Object[][] rowData = new Object[entries.length][3];
//feed the table of new data
for(int i=0;i<rowData.length;i++)
rowData[0] =new Integer(entries[i].getTimesUsed());
rowData[i][1] = entries[i].getName();
rowData[i][2] = entries[i].getText();
String[] columnNames = {"Cnt","Name","Text"};
// Create a new model and load it with new values
DefaultTableModel model = new DefaultTableModel(rowData, columnNames) {
public boolean isCellEditable(int row, int col){   return false; }
tblEntryList.setModel(model);
TableColumn col = tblEntryList.getColumn(tblEntryList.getModel().getColumnName(0));
col.setPreferredWidth(10);
col = tblEntryList.getColumn(tblEntryList.getModel().getColumnName(1));
col.setPreferredWidth(25);
I dont know what i'm doing wrong here but it ddint work..

Similar Messages

  • Please help me about Workflow

    sir/mam,i am new for workflow,will any one give me guidence for how i will start with workflow ..please help me about this topic....?

    Somnath,
    Your question is very vague.  What do you mean by new to Workflow?
    Workflow can be defined as
    A workflow is a reliably repeatable pattern of activity enabled by a systematic organization of resources, defined roles and mass, energy and information flows, into a work process that can be documented and learned. Workflows are always designed to achieve processing intents of some sort, such as physical transformation, service provision, or information processing.
    Workflows are closely related to other concepts used to describe organizational structure, such as silos, functions, teams, projects, policies and hierarchies. Workflows may be viewed as one primitive building block of organizations. The relationships among these concepts are described later in this entry.
    Read more on the Web ..http://en.wikipedia.org/wiki/Workflow
    Suda

  • Please help me about question security because in my apple id no have for restart or chenge my answer

    please help me about answer security question in my apple id because im forgot for my answer, in my apple id no have for change answer, tell me for this please because i love my iphone.
    <Email Edited by Host>

    You need to ask Apple to reset your security questions; this can be done by clicking here and picking a method, or if your country isn't listed, filling out and submitting this form.
    They wouldn't be security questions if they could be bypassed without Apple verifying your identity.
    (110899)

  • I am looking for macbookpro mid 2010 HDD exact specs so that i can upgrade it to 1TB. PLEASE HELP ME  about OEM apple brand or which one is better.Thanks

    I am looking for macbookpro mid 2010 HDD exact specs so that i can upgrade it to 1TB. PLEASE HELP ME  about OEM apple brand or which one is better?.Thanks

    clintonfrombirmingham Your information is not correct.
    http://kb.sandisk.com/app/answers/detail/a_id/8142/~/difference-between-sata-i,- sata-ii-and-sata-iii
    I have a sata II samsung 5400 rpm and i am only able to transfer at 85 read right speed.
    On my main drive sata III ocz agility 3 ssd i get 120 mb read and 180 write.
    Neither of these come close to the 300 mb promised. So it wont matter if he got sata II or III
    The speed came from Blackmagic Disk Speed Test

  • I've upgraded to 13.I can't see fonts in search bar & tabs.Please help.If u need screenshots,please share me the site of image sharing.Thanks!

    I've upgraded to 13.I can't see fonts in search bar & tabs.Please help.If u need screenshots,please share me the site of image sharing.Thanks!
    [http://www.flickr.com/photos/80001361@N06/7346073414/in/photostream http://www.flickr.com/photos/80001361@N06/7346073414/in/photostream]

    Looks like a font problem.<br />
    Firefox seems to be using a font that isn't working properly.
    Try this solution: [[/questions/927322#answer-336404]]

  • Please help me about jdeveloper application deployment for weblogic

    At the beginning I just thought after developing an adf application then just deploy it as a .ear file and deploy it in the weblogic console and everything will be ok.But in fact I got a lot of problems. Then I got a tutorial for that and I do what it said step by step but some new problems occured. This is the tutorial I mentioned: [How-To: ADF Deployment Guide|http://www.oracle.com/webfolder/technetwork/jdeveloper/howto/11114/managedserver/wlsadfms.htm]
    Now could somebody tell how did you deploy your adf application?
    Here is the errors I got.
    This is the install packege and the OS I use:
    1. CentOS 6.3_x64 + jdeveloper11123.jar(include wls10.3.5) + adr(package name is ofm_appdev_generic_11.1.1.6.0_disk1_1of1.zip)[and just now I used a solaris11 vm from oracle and install jdeveloper11.1.2.3, the same probem occured as in CentOS.]
    2. Win7_x64 + jdeveoper11123.exe(include wls10.3.5) + adr mentioned above
    Here is the problems I get:
    in the case 1,after I install the jdeveloper(using sun jdk 1.7), the weblogic seems to be well though I didn't configure a domain.But after I open an
    application(which I get from the oracle jdeveloper tutorial demo,which works well in my Win7 env) and I run it, the integrated weblogic can't get
    started. Firstly in the console it said the -jrocket identifier is not recognized, then I modify the setDomainEnv.sh and the startWebLogic.sh file in the
    integrated wls domain (the one in the .jdeveloper directer) to set the JAVA_VM variable to -server.After that another problem came out: when the
    wls goes to status "starting",it is blocked and I turn to the system monitor it shows that a java thread using more than 1GB of memory of my system
    and occupy 150% of my cpu(it's a double-core computer). I wait for about 5 minutes when a error came said "PermSize is too small".then I modify the
    setDomainEnv.sh file again to set the PermSize to be 1024m and MaxPermSize to be 2048.(the variable name is something like that, maybe not the
    exactly right. I think you can understand which one it is.) But the problem is still there.
    then in the case 2.Firstly the jdev and the integrated wls works well, but when i deploy an application which works well to a ear file and deploy it to a
    standalone wls(10.3.5) it never works.the error is something referrence/dependences libraries is not found.Then I tried to new a server connection to
    the standalone wls and I got the tutorial [how_to_deploy_adf|http://www.oracle.com/webfolder/technetwork/jdeveloper/howto/11114/managedserver/wlsadfms.html] , as the tutorial said I patch my standalone
    wls with the adr and everything goes ok, no error reported.Then I tried the new server in the new machine under the manage of the adminserver and apply the
    adf template in the localhost:port/em console. But after I restart the new server(by the console and then by the stop+startweblogic.bat file) the server is running
    while the application in the new server is just "Unavailable". I tried this for three times in three computer, two of them are running win7,the other one is running winxp.
    I don't know what is wrong and I am totally a newbie about this. Somebody please help me.Thanks a lot!
    regard,Neo.

    Neo,
    there are a couple of problems. First of all, jdev comes with it'S own jdk bundled in the product (jdk 1.6_x). Next thing is if you use JDev 11.1.2.3.0 to build an application you must use a wls 10.3.5 or 10.3.6 where you need to install the correct runtime onto. In your case you first install adf runtime 11.1.1.6.0 and then you need to install two patches which update the adf runtime to 11.1.2.3.0. These spathes are only available via support.oracle.com, meaning you need asupport contract to get them.
    More information you can find in my blog http://tompeez.wordpress.com/2011/09/14/jdeveloper-versions-vs-weblogic-server-versions/
    The rest of your problems go away once you have installed the right adf runtime on your server.
    Timo

  • Please help me about samples project with COM UI DI

    I run sample project
    C:\Program Files\SAP\SAP Business One SDK\Samples\COM UI DI\VB.NET\AddColumn
    but i can't test becoz i don't know screen b1 matching with oForm.TypeEx = "65270"
    Please tell me about screen b1 for test this code

    I don't know the answer right away, but:
    - take a look into the FAQ in the Wiki (https://www.sdn.sap.com/irj/sdn/wiki?path=/display//b1/faq)
    - there go to "UI Forms"
    ...and find these links (mid-term we want of course more information directly available in the Wiki...):
    List of form IDs:
    /people/lutz.morrien3/blog/2004/10/01/all-sap-business-one-formtypes-at-one-look
    Update: https://weblogs.sdn.sap.com/cs/user/view/cs_msg/14059
    The hints in the update will help you to get the title of the form - and thus will give you a hint where to look for the form. For your convenience I have copied the "relevant code here:
    Dim Info As FormInfo = Application.ResourceData.GetFormInfo("65270")
    FormInfo.Title
    ...gives you the title of the form

  • Please help in storing JTable in database

    hai Abrami,
    I saw in JDK\bin\demo\jfc\Tableexample. but it contans example only for populating the Table with the values from database which I finished alraedy. But I treid of storing the Table values in database using VArray. but it contradicts with the several operations such as retireving Single field from database Updating the database when value single populated table changes.
    So please help me in this.This isthe final part of project.

    Bathina,
    Did you try doing an Internet search? I did one for the terms "jtable" and "database". Here are my results:
    http://tinyurl.com/4ttl4
    And if you just want someone to do your work for you, then try HotDispatch or Rent-A-Coder (or similar -- there are lots of others like these two).
    Good Luck,
    Avi.

  • Please help - Stuck with JTable???

    Hi everyone, i have had this problem now for ages and really wanna solve it - hope u can help!
    I have a Jtable and basically column 3 has a value in it, column 4 is editable and takes in a value that the user enters. I need to take the value from column 3 and multiply it by the number entered into column 4 to update column 5 with the result.
    I have looked over and over the API for this and saw working examples, however i am using my own table model class and finding it hard to adapt these examples to work with my code, below is my table model class and the method i have written to try undertake this piece of functionality, can anyone help me get this working - dukes!!
    class ResultSetTableModel extends AbstractTableModel {
    protected Vector columnHeaders;
    protected Vector tableData;
    protected Vector rowData;
    private Connection con;    
    private int column_count;
    int QTY_COLUMN = 4;
    private double value;
    private JTable table;
    public void fillTableModel (ResultSet result) throws SQLException {
         ResultSetMetaData rsmd = result.getMetaData();
         int count = rsmd.getColumnCount();
         columnHeaders = new Vector();
         tableData = new Vector ();
         for (int i = 1; i <= count; i++)
              columnHeaders.addElement(rsmd.getColumnName (i));
              //System.out.println(rsmd.getColumnName(i));
         columnHeaders.addElement("Qty");
         columnHeaders.addElement("Total");
         while (result.next())
              rowData = new Vector (count);
              int row = 0;
              for (int i = 1; i <= count ; i++)
                   rowData.addElement (result.getObject(i));          
              rowData.addElement("4");
              rowData.addElement("0.00");
              tableData.addElement (rowData);
         result.close();
         fireTableDataChanged();
    public int getColumnCount ()
         return columnHeaders.size();     
    public int getRowCount ()
         return tableData.size();          
    /*public Object getValueAt (int row, int column)
         Vector rowData = (Vector) (tableData.elementAt (row));   
         return rowData.elementAt (column);
    public Object getValueAt(int row, int col){  //This is the method i have written
         int sum = 0; 
         if(col == 5) {   
         try {     
              sum = Integer.parseInt((String)getValueAt(row, 3)) * Integer.parseInt((String)getValueAt(row,4));//Need to take a user input here instead of a value - i think!   
         catch (Exception e)    { //Sum above not working as column 5 displays the number 4 in each row     
              sum = 4;   
         return (new Double(sum)); 
         else  {   
              Vector rowData = (Vector) (tableData.elementAt (row));   
              return rowData.elementAt (col); 
    public boolean isCellEditable (int row, int column )
         return (column == QTY_COLUMN);
    public String getColumnName (int column)
         return (String) (columnHeaders.elementAt (column));
    public void emptyColumn(int column){   
         int rowCount = tableData.size();       
         for (int i = 0; i < rowCount; i++)    {       
              Vector rowData = (Vector)tableData.elementAt(i);               
              rowData.setElementAt("", column);   
         fireTableDataChanged();
    public void setValueAt(Object value, int row, int column) {
             ((Vector)tableData.elementAt(row)).setElementAt(value, column);
             fireTableCellUpdated(row, 5);
    }Can anyone please help and yes im desperate, he he
    Thanks in advance

    Here's something:import java.awt.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.table.*;
    public class Test extends JFrame {
        public Test () {
            getContentPane ().setLayout (new BorderLayout ());
            getContentPane ().add (new JTable (new TestModel ()));
            setDefaultCloseOperation (EXIT_ON_CLOSE);
            setTitle ("Test");
            pack ();
            setLocationRelativeTo (null);
            show ();
        public static void main (String[] parameters) {
            new Test ();
        private class TestModel extends AbstractTableModel {
            private java.util.List data;
            public TestModel () {
                data = new ArrayList ();
                data.add (new Pair (3, 4));
                data.add (new Pair (1, 7));
                data.add (new Pair (2, 9));
                data.add (new Pair (6, 5));
                data.add (new Pair (8, 0));
            public int getRowCount () {
                return data.size ();
            public int getColumnCount () {
                return 3;
            public Object getValueAt (int r, int c) {
                Pair pair = (Pair) data.get (r);
                int value;
                switch (c) {
                    case 0:
                        value = pair.a;
                        break;
                    case 1:
                        value = pair.b;
                        break;
                    default:
                        value = pair.a * pair.b;
                        break;
                return new Integer (value);
            public Class getColumnClass (int c) {
                return Integer.class;
            public boolean isCellEditable (int r, int c) {
                return c < 2;
            public void setValueAt (Object wrappedValue, int r, int c) {
                Pair pair = (Pair) data.get (r);
                int value = ((Integer) wrappedValue).intValue ();
                switch (c) {
                    case 0:
                        pair.a = value;
                        break;
                    case 1:
                        pair.b = value;
                        break;
                fireTableRowsUpdated (r, r);
            private class Pair {
                public int a;
                public int b;
                public Pair (int a, int b) {
                    this.a = a;
                    this.b = b;
    }Kind regards,
      Levi

  • Please help: question about eclipse & xerces

    hi,
    i have eclipse 3.0 and am trying to get the xerces java package (ver 2.6.2) to work for it. i downloaded xerces from this link: http://www.apache.org/dist/xml/xerces-j/
    there are so many different files in there, i'm not entirely sure if you download everything or just one. anyway, the one i downloaded was the fourth one down, called xerces.j.bin.2.6.2.zip (5.6m in size).
    i've unzipped it, but am unsure how i go about configuring eclipse 3.0 so that i can import and make use of xerces in my java apps. could anyone who has experience with this please help me?
    thanks,
    ramsey

    it's OK guys, took me ages but i got it sorted.

  • HT4623 Please help me about my iphone5 after I upgraded it into iOS 7.0.4 I got the problem about my connections I can't really have a good connections to my server if I'm in my bedroom and I can't connect to any wifi connection not even searching

    Please help me restor my system in my iphone5 Bcoz I got this problem that I can't connect to our wifi in our home after I upgraded this iOS7.0.4...totally very disturbing and frustrating even my outside I can't search any wifi connections ant my network service when I'm in home is very slow my Rogers network is only 1 bar so even I will open my Data I can't really connect so meaning no network connections when I'm in my Bedroom and No wifi connections too I can only possible got connections when I get near the Reuter of the wifi like now while I'm doing this report but in my bedroom totally nothing and not even connecting when I bring this to Rogers outlet where I bought this iPhone,I can't even search or connect in the store wifi itself...very disappointed this problem last 1week already please help me it never happen before just now after I upgrade that iOS7.0.4

    Thanks for this mha007 - I can now open FF with a new profile. Can I copy my settings from the old profile or will this bring over the same problem, maybe a corrupt file. If it would bring the same problem, is there any way I can check which file is corrupt, apart from taking them over one by one?

  • Please help me about Work Schedule.

    Dear all,
    On my client have schedules are below :
    -   Form Monday to Friday: Is working day for all employees except IS department and Driver Group and  Saturday, Sunday are  Holiday.
    -   IS Department : Employees work 5 days a week with rotating basic service on Saturday, compensated by one weekday off.
    -   Driver group have 6 working days on a week (Mon-Sat). Sunday is holiday.
    I have not solution to config . Please help me to define and config to solve my problem.
    Thanks for your help.
    Huyen Nguyen

    Dear Arun Sundararaman,
    Thanks for your anwers. But can you help me more for creating a specific Personnel Subarea Grouping for Daily Work Schedules for drive group. I can't create this because I use Personnel Subarea Grouping to define Branch Office, Head Office,On-site Abroad office,. . . so is there solution else ?
    Thanks for your supports.
    Huyen Nguyen

  • SOS! Please help me about GeoRaster Mapviewer problem!!

    Hi!
    I am very miserable. I want to see GeoRaster Data with MapViewer 10. I have finished all guides but No result. The following details:
    - I load image into Georaster successfully and estable extentspatial, metadata,etc.. as Mapviewer guide for Georaster theme at location 2.3.6.
    - After that, I copy jai_core.jar and jai_codec.jar into ../web/Web-Inf/lib.
    - Then repair MapviewerConfig.xml to respone to my Database.
    - Then at window of Mapviewer, I paste my Map request following:
    xml_request=<?xml version="1.0" standalone="yes" ?>
    <map_request
    title=""
    datasource="ThoaGlobName"
    width="288"
    height="192"
    format="GIF_URL" >
    <themes>
    <theme name="geor_theme" >
    <jdbc_georaster_query
    jdbc_srid="82216"
    datasource="ThoaGlobName"
    georaster_table="ThoaImage"
    georaster_column="Image"
    raster_id="1"
    raster_table="ThoaImageRDT"
    asis="false">
    </jdbc_georaster_query>
    </theme>
    </themes>
    </map_request>
    Then click Submit button.
    I see MapViewer give errors following:
    <?xml version="1.0" encoding="UTF-8" ?>
    <oms_error>Message:[oms] error parsing given xml map request. Fri Sep 29 22:56:18 PDT 2006 Severity: 0 Description: oracle.xml.parser.v2.XMLParseException: Start of root element expected. at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:205) at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:305) at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:267) at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:253) at oracle.lbs.mapserver.oms.parse(oms.java:606) at oracle.lbs.mapserver.oms.getXMLDocument(oms.java:864) at oracle.lbs.mapserver.oms.doPost(oms.java:303) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112) at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186) at java.lang.Thread.run(Unknown Source)</oms_error>
    PLEASE HELP ME! I do not know where I wrong. It is time for me to post my final test. I am very worried! I am regard high your help.Thank you so much!

    If you take a look in this category of different forums, you will find one that discusses e.g. GeoRaster.

  • Hi please help me about this diagram I'm confused (sigh). Its about 7-SEGMENT LED.

    The first 7-segment LED is for ones and the other is for tenths. The output should be from 00 - 15. My output is wrong please help me. I already used Kmap to reduce my equations. Please help!
    Attachments:
    LODSIGN 2_2(TAMA).ms12 ‏314 KB

    Truth Table:
    A | B | C | D           ---------       OUTPUT
    0   0    0   0                              00
    0   0    0   1                              01
    0   0    1   0                              02
    0   0    1   1                              03
    1   1    1   1                              15

  • Could you please help me about error 1009?

    I can not update or dawnload anything even free programs what should I do with this error??????? Please help me 

    Where are you located? Error 1009 is usually associated with a blocked country where Apple is prohibited by law from selling software. It could also be a problem with some proxy settings in your network.

Maybe you are looking for

  • How can I delete the null in list

    hi all when I make any list always in the list null after all the value how can I delete this null value thanks

  • Upgrade grdi infrastructure 11.2.0.1

    Hello gurus. I have Grid Infrastructure version 11.2.0.1 with ASM running on linux vm and 3 stand alone databases version 11.2.0.1. I need to know if it's possible to upgrade both Grid Infrastructure and databases to version 11.2.0.3. I researched an

  • Finder not reponding

    I recently updated to mountain lion on a macbook pro (mid 2010) everything is working fine exept for my finder, I have updated all my software, (I dont have a lot of 3rd party aplications) and is becoming annoying as **** especially when i try to acc

  • Reading Classification data for material

    Hi all can anybody give me a FM or BAPI to read the classification data for a particular material.. Kindly help . apt points will be rewarded Regards N manjrekar

  • Smart Update issue of WebLogic Portal 10.1 MP1

    I got an issue when ran WebLogic Smart Update on install Patch 6XYT. System prompt error message: "Unable to locate any supported product installations. Click OK to locate a BEA Home with valid target installations." Even I clicked OK and specified t