Inserting Custom object in JTable

Hi All
I am new to JAVA.
I am trying to insert custom data to JTable.
Example:
I have a class called Student with some instance fields(like Name,age,sex ), and I want to add object of Student type to JTable.
In table I want to display Student class fields. I have extended a class StudentModel from AbstractTableModel.My StudentModel
contains a Vector to keep student data.
But how do I add student object to StudentModel.and display in JTable
please help
thanks in advance

Hello,
apparently your problem is not related to Swing but to learning the Java language.
If your aim is to learn Java, you should tackle this compile error. For that I suggest you turn to a colleague or a fellow student... or continue here, but you need to give more code than just the bit that doesn't compile.
If your aim is to make the darn program display students in a JTable, you can have a look at BeanTableModel (http://tips4java.wordpress.com/2008/11/27/bean-table-model/).
Best regards,
J.

Similar Messages

  • Data Loader On Demand Inserting Causes Duplicates on Custom Objects

    Hi all,
    I am having a problem that i need to import around 250,00 records on a regular basis so have built a solution using Dataloader with two processes, one to insert and one to update. I was expecting that imports that had an existing EUI would fail therefore only new records would get inserted (as it says in the PDF) but it keeps creating duplicates even when all the data is exactly the same.
    does anyone have any ideas?
    Cheers
    Mark

    Yes, you have encountered an interesting problem. There is a field on every object labelled "External Unique Id" (but it is inconsistent as to whether there is a unique index there or not). Some of the objects have keys that are unique and some that seemingly have none. The best way to test this is to use the command line bulk loader (because the GUI import wizard can do both INSERT/UPDATE in one execution, you don't always see the problem).
    I can run the same data over and over thru the command line loader with the option to INSERT and you don't get unique key constraints. For example, ASSET and CONTACT, and CUSTOM OBJECTS. Once you have verified whether the bulk loader is creating duplicates or not, that might drive you to the decision of using a webservice.
    The FINANCIAL TRANSACTION object I believe has a unique index on the "External Unique Id" field and the FINANCIAL ACCOUNT object has a unique key on the "Name" field I believe.
    Hope this helps a bit.
    Mychal Manie ([email protected])
    Hitachi Consulting

  • Insert/Query records of custom objects

    We are looking for a generic programmatic solution to query/insert/delete records of custom objects. Using different WSDLs for custom objects and making calls to APIs of multiple stubs is NOT a generic solution. The main purpose of generic solution is – least bother about the number of custom objects present in any OCOD instance and their WSDLs. I am a bit ready to take minor hit on performance and others.
    Any suggestion? Idea?

    We are looking for a generic programmatic solution to query/insert/delete records of custom objects. Using different WSDLs for custom objects and making calls to APIs of multiple stubs is NOT a generic solution. The main purpose of generic solution is – least bother about the number of custom objects present in any OCOD instance and their WSDLs. I am a bit ready to take minor hit on performance and others.
    Any suggestion? Idea?

  • Insert Books under Custom Object 15

    We need to insert/remove a Custom Object 15 record into books. Is this possible in Web Services 2.0 toolkit?

    Right. I mean Oracle really needs to get their messaging straight with this stuff. They put out release notices saying R16 will have unlimited objects, but they don't mention that it's not for everybody. Then, I call "Customer Care" and they tell me there's no such thing as unlimited custom objects for anyone. So their corporate messaging and call center are not on the same page with this feature. That's extremely frustrating.

  • Inserting Entry into Custom Object with API

    Hello,
    I have a custom object made and access to both BULK and REST APIs.
    I was wondering how I could take the information I have (It's only 4 fields) and inserting this information as a new record into my data object.
    I have the ID for my data object I just can't seem to find the API call I'm looking for.
    Any help is greatly appreciated!

    Adding new records to a Custom Object is best done using the Bulk API.  You need to define a Custom Object import and use it to sync your records into Eloqua.

  • Help needed for translation of custom objects

    Hi All,
    We are currently in the process of upgrading from 11i to R12.1.3. We have a lot of custom reports and forms which needs to be translated based on language preference set at user level. The approach we have taken is as follows:
    1. Created one unique look up type for each of the custom objects.
    2. Each lookup code is mapped to a field of the custom object (report or form).
    3. Entered the translation for each of the lookup codes using Globe icon (Translation Form) available on the lookup form.
    4. When the user logs into his account, we are filterting out the record specific to user environment language using the condition:
    language of fnd_lookup_values = usernev('lang') and getting the translated labels for each of the fields in the custom object.
    Now what we would like to understand is if there is any other better way of doing translation based on user preferred language.
    We have heard about Oracle Translation Manager (OTM) but not sure how the same can be used in our case. Also we would like to know how Oracle does translation for the languages that are enabled in a particular instance. We would like to know if a similar approach can be followed for custom objects as well.
    Thanks & Regards,
    Sreenivasa M

    Implode wrote:
    We had the arrayList/collections lecture today.
    I asked the teacher about sorting objects and he started explaining hashmaps and then he mentioned another thing which we will only be learning next term, I'm sure we must only use what we have learned.
    How exactly can this be done. I have asked a few questions in the post already.
    ThanksWell, there was probably a gap in the communication. Hash maps (or hash tables, etc.) are instance of Map. Those are used to locate a value by its unique key. Generally, to speed up access, you implement a hashing function (this will be explained hopefully in class). Think of name-value pairs that are stored where the name is unique.
    Contrast this with items that are sorted. Any List can be sorted because its elements are ordered. An ArrayList is ordered, generally, by the order you inserted the elements. However, any List can be given its own ordering via Comparable or Comparator. You can't do this with an ordinary Map. The purpose of a Map is speedy access to the name-value pairs, not sorting. The List likewise has different purposes, advantages, disadvantages, etc. List can be sorted.
    A Map is generally similar to a Set. A Set is a vanilla collection that guarnatees uniqueness of each element (note, not name-value pairs, but simple elements). There is one concrete class of Map that can be sorted, TreeMap, but I doubt your professor was referring to that. The values or the keys can be returned from the Map and sorted separately, but again, I doubt he was referring to that.
    Take a look at the Collections tutorial here on this site or Google one. It is fairly straightforward. Just keep in mind that things (generally) break down into Set, Map and List. There are combinations of these and different flavors (e.g., Queue, LinkedHashMap, etc.) But if you can learn how those three differ, you will go a long way towards understanding collections.
    (Oh, and be sure to study up on iterators.)
    - Saish

  • Inserting Pics in a JTable

    I'd like to include an ID of the person within my table.
    Using DefaultTableModel and ImageIcon, how can I insert a picture?
    Is it even possible to enter a non-textual entry into a JTable?
    Here's what I did:
    JMenuItem insertPicture;
    JTable contactTable;
    DefaultTableModel details;
    else if(ae.getSource() == insertPicture)
      // Column and row details
      int row = contactTable.getSelectedRow();
      int column = contactTable.getSelectedColumn();
      // Using a string to store the picture's location details
      String fileName;
      FileDialog location = new FileDialog(ContactDetails.this,   
                "Choose picture", FileDialog.LOAD);
      // Displaying the FileDialog
      location.show();
      // Getting the image and inserting it in the JTable
      ImageIcon image = new ImageIcon(location.getDirectory()+
      location.getFile());
      details.setValueAt(image, row, column);
    }My problem is that within the row (to which the picture should be placed), I'm getting only the String description of the image's location. How can I correct this?
    Much thanks in advance!
    Reformer!

    import java.awt.*;
    import java.net.*;
    import javax.swing.*;
    import javax.swing.table.*;
    public class Test {
        public static void main(String[] args) throws MalformedURLException {
            DefaultTableModel model = new DefaultTableModel(new String[]{"path","image"}, 0) {
                public Class getColumnClass(int columnIndex) {
                    return columnIndex==1? Icon.class : String.class;
                public boolean isCellEditable(int rowIndex, int columnIndex){
                    return false;
            URL[] urls = {
                new URL("http://today.java.net/jag/bio/JagHeadshot-small.jpg"),
                new URL("http://today.java.net/jag/bio/JAG2001small.jpg"),
                new URL("http://blogs.sun.com/roller/resources/jag/2005_09_14_03-44-21-438_n1.small.png")
            for(int i=0; i<urls.length; ++i)
                model.addRow(new Object[]{urls.toString(), new ImageIcon(urls[i])});
    JTable table = new JTable(model);
    table.setRowHeight(240);
    JScrollPane sp = new JScrollPane(table);
    sp.setPreferredSize(new Dimension(600,450));
    final JFrame f = new JFrame();
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.getContentPane().add(sp);
    f.pack();
    SwingUtilities.invokeLater(new Runnable(){
    public void run() {
    f.setLocationRelativeTo(null);
    f.setVisible(true);

  • How to "save" custom objects in keynote

    I've created custom art / objects in keynote that I'd like to reuse and quickly insert into presentations.  Is there a way to "store" or "save" the custom artwork in my version of keynote for quick recall?

    Hi, Offline edition doesnt support custom objects or any other object that is not available as part of the default offline solution. Hope it helps
    -- Venky CRMIT

  • Is it possible to have an adress field with a Custom Object?

    Hello,
    I would like to link a service request to an account and an intermediary such as a travel agency. But the original datamodel only allow one account per Service Request.
    So, I have created a custom object (Intermediary) that should have similar relations with other objects than the Account one. With this object, I will be allowed to link my two accounts to the SR. But I would like to insert an address field in my custom object. Unfortunately, this kinf of custom field type is not available...
    Is there any solution to have one? Or is there another solution I could use to link 2 accounts to a Service Request?
    Thanks in advance,
    Laurent

    We had the same problem. Decided to use one of the new custom objects (CO-05) for this purpose. The drawback of using it this way is the lack of automatic formating of the address lines by country selected like you get with accounts and contacts. On the good side, you can designate fields for use in interfacing with your external business system, i.e. Oracle eBS, JDE, etc.
    We also added a link to this to bring up a modified Customers On Line form from Oracle eBS that gives us a view of the Quotes, Orders, Service Requests, Installed Base, Invoices and Credit Memos by customer party id number contained in eBS. This is what we call a 360 degree view of the customer.
    Neil @ Emerson Process

  • Custom object - data loader issue

    Hello guys.
    I've just attempted to upload a CSV file in order to insert new records to a custom object.
    after some tweaking I've managed to get it to work, the log stated 100% success but no new records appeared.
    I've ran the data loader for "ordinary" objects (account, parts) with full success.
    Any thoughts?
    Thanks,
    Adi Smulian
    [email protected]

    The dataloader will often state 100% this does not mean that all the records were imported correctly. You will need to go to the data import queue to retrieve the findings of the import this will then tell you if you have any errors.

  • Problem finding object for Custom Object Test

    I need to create a custom object test that tests whether a an element is present after a record gets inserted into the database. The script is databanked and each iteration needs to insert a databanked record, then evaluate my custom object test to make sure the record was inserted. The trick is in writing the expression that finds the correct custom object. After one iteration, this is the code that finds the custom object;
    RSWApp.om.GetElementByPath "window(index=0).link(text=""Category D"" | href=""javascript:OpenModal('DocumentCategoryAddEdit.aspx?documentCategoryId=377','400');"" | index=19)", element
    Instead of always grabbing the object whose text is "Category D", I want to grab the object whose text is <<category>> (ie retrieved from a databank file). Search in the href or index isn't helpful because these will change with each iteration through my script.
    I tried to modify the GetElementByPath to this:
    RSWApp.om.GetElementByPath "window(index=0).link(text=dbValue|)", element
    where dbValue is a local parameter that I set earlier on. When I run this, I get an object not found error.
    Any ideas?

    I much prefer to use RSWAPP.om.findElement. It is much more robust than FindElements.<BR>
    RSWApp.GetDatabankValue Is what is needed anytime you want to return Databank values to the VBA environment<BR>
    <BR>
    Your code should look something like the following:<BR>
    <BR>
    Dim dbVal as string
    <BR>
    RSWApp.GetDataBankValue "MyDbVariable", dbVal<BR>
    <BR>
    This will return the contents of "MyDbVariable" which is defined and bound in the databank wizard to VBA variable dbVal.<BR>
    <BR>
    You can then use DBVal in your path:
    <BR>
    RSWApp.om.GetElementByPath "window(index=0).link(text="" & dbVal & "" | href=""javascript:OpenModal(&#39;DocumentCategoryAddEdit.aspx?documentCategoryId=377&#39;,&#39;400&#39;);"" | index=19)", element<BR>
    <BR>
    If you decide to use Find elements instead of GetElementByPath, the syntax would like the following: <BR>
    <BR>
    Set element = RSWApp.om.FindElement(dbVal, "A", "InnerText") <BR>
    As you can see it is much simpler.<BR>
    <BR>
    Hope this helps!

  • Custom objects in activity

    Hello all,
    I configured the screen for activity with relation a custom object 1, the custom object I can read, insert, edit ... with no problem the record, but I think that not real relation into record of custom object and record of activity.
    with a report from custom object if link with activiity no data found, if no link with activity the data from custom object is show.
    I need configure any more ?, or is not automatic the relation.
    thank's

    Mani J wrote:
    Have you added new picklist field/value today? If yes you will have to wait till tomorrow.
    -Check your Related Info access profile settings for Activity and CO.not i don't added anything, and today I have the same problem
    the level access from Activity & CO 1 is full access.
    thank's for your interest.

  • Custom OBJECT sizes and HTMLEditorKit

    Hi there all, I have a fairly tricky problem that I'm in a rush to get fixed.
    I need to know how to get a TextComponent (JTextArea etc) to wrap when being displayed as part of a web page in a JEditorKit.
    Don't worry, I'm not writing a HTML editor, but am using HTML as a template for a report with the OBJECT tag being the point where the application inserts custom components. The problem I'm having is that when using JTextArea as one of these components the text doesnt want to wrap and just stays on one line. I tracked the problem to a preferredSize issue and the underlying layout not forcing sizing constraints on the text component, letting it just carry on, on the same line.
    If anyone knows how to get the component to take its width from the parent component but specify its own height, help would be much appreciated.
    Also on a similar note, the ideal solution to this would be to not to use Components at all but override the existing ParagraphView in the text.html package, but I need these View components to be able to show menus and things, which is why I opted for the Component aproach. If anyone knows of an easy way to get these Views to accept events then I think this would be preferable.
    Hope that all makes sense :o)
    Example:
    <html>
       <head/>
       <body>
          <table width="100%">
             <tr><td>Created by <object classid="companyLogo" /></td></tr>
             <tr><td><object classid="companyMotto" /></td></tr>
             <!-- Some other stuff -->
          </table>
       </body>
    </html>This template will display (in a JEditorPane) a table with the text "Created by " then the application will insert an image (the company logo), then the EditorKit will insert another row and the application inserts the company motto. But if the company motto is long then i want it to wrap onto another line, but instead it will just keep going off the edge of the page.
    NOTE I am setting all sizes (pref, min and max) of the JEditorPane and it stays the same size but the text just carries on past the boundry and doesn't get painted.
    Thanks for any help in advance.
    deej

    I fixed the problem, i forgot to put the setLineWrap(true) in there :$ oops. Found an interesting bug tho. Given the HTML :
    <html><head /><body>
       <table width="100%">
          <tr><td>some text</td><td width="100%">some more text</td></tr>
          <tr><td colspan="2"><object classid="paragraph" /></td></tr>
       </table></body>
    </html>I get a wierd resizing problem where the JTextArea i use to display paragraph resizes itself until it has only one line and goes off the side of the page. The only way i found to fix it so far is to place the second row into its own table. Not sure where this bug lies but it was fairly surprising when it first happened.
    deej

  • How to insert custom HTML before /body ?

    I love that I can insert custom HTML in the <head> of a page in Muse.
    However, I need to add custom HTML just before the end of <body>.
    Namely, I want to insert custom Jquery calls just before </body>. I can't do this in the <head>.
    However, other uses for other people might include inserting Analytics tracking code before </body>, as this is more optimum than in the <head>.
    I've tried using a Custom HTML widget, but even if I put it in the footer of my page, it still ends up appearing in the rendered HTML before Muse's Javascript. I need it to come after Muse's Javascript.
    Thanks in advance.

    Hi Harry,
    Please check this discussion, you might find it helpful in making the jQuery calls.
    How to (make best) use external js library from html object (need help from dev)
    http://forums.adobe.com/thread/1213057
    - Abhishek Maurya

  • Custom Object Definitions

    Hello all,
    Is it possible to export / import the definition of a custom object? We want to create a custom object definition locally and then distribute it to customers so that they have a custom object with the same exact definition.
    Thank you,
    -Kevin

    Thanks bobb.
    Let me just clarify my question about "creating" custom objects through web services. I'm not talking about INSERT of a new row into a custom object definition, i'm talking about basically taking CustomObject13 (for example) and through web services, change it's schema to what i need by creating custom fields on it, etc... so basically creating the definition / schema of a custom object through web services.
    -Kevin

Maybe you are looking for