SAMPLE CODE  + HOW ADD JCOMBOBOX IN JTABLE

HI,
ALL OF U
PLZ SUGGEST ME HOW TO ADD COMBOBOX IN JTABLE.
AND ALSO TELL HOW WE CAN ADD ITEMS IN COMBOBOX AT RUN TIME.
PLZ SUGGEST ME.
THANX IN ADVANCE.
BYE

Hi if you google you find a lot
http://www.google.be/search?q=JTable+combobox&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:nl:official&client=firefox-a
and
http://www.google.be/search?q=JTable+combobox+example&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:nl:official&client=firefox-a
Satanduvel

Similar Messages

  • Cannot find sample code: how-to-jazn.war/jar

    Hi,
    As referenced in this online article
    http://otn.oracle.com/tech/java/oc4j/htdocs/how-to-jazn.html I cannot find where this sample code is located. Does anyone know where this is?
    Thanks

    Find it here
    http://download.oracle.com/otn/java/oc4j/how-to-jazn.zip
    Chandar

  • A sample code how to get all menu, sub menu or button?

    I hesitate to ask this, but what problem are you trying to solve?
    The first step is to look into DOM manipulation with PowerShell.

    Please provide the sample code for
    1.  Navigating to https://www.google.com
    2.  Clicking on Sign in button
    3.  Providing user name and password (in the security from reading in the text file)
    4.  Sign out
    5.  Exit
    Thank you in advance
    This topic first appeared in the Spiceworks Community

  • How to write the JTables Content into the CSV File.

    Hi Friends
    I managed to write the Database records into the CSV Files. Now i would like to add the JTables contend into the CSV Files.
    I just add the Code which Used to write the Database records into the CSV Files.
    void exportApi()throws Exception
              try
                   PrintWriter writing= new PrintWriter(new FileWriter("Report.csv"));
                   System.out.println("Connected");
                   stexport=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
                   rsexport=stexport.executeQuery("Select * from IssuedBook ");
                   ResultSetMetaData md = rsexport.getMetaData();
                   int columns = md.getColumnCount();
                   String fieldNames[]={"No","Name","Author","Date","Id","Issued","Return"};
                   //write fields names
                   String rec = "";
                   for (int i=0; i < fieldNames.length; i++)
                        rec +='\"'+fieldNames[i]+'\"';
                        rec+=",";
                   if (rec.endsWith(",")) rec=rec.substring(0, (rec.length()-1));
                   writing.println(rec);
                   //write values from result set to file
                    rsexport.beforeFirst();
                   while(rsexport.next())
                        rec = "";
                         for (int i=1; i < (columns+1); i++)
                             try
                                    rec +="\""+rsexport.getString(i)+"\",";
                                    rec +="\""+rsexport.getInt(i)+"\",";
                             catch(SQLException sqle)
                                  // I would add this System.out.println("Exception in retrieval in for loop:\n"+sqle);
                         if (rec.endsWith(",")) rec=rec.substring(0,(rec.length()-1));
                        writing.println(rec);
                   writing.close();
         }With this Same code how to Write the JTable content into the CSV Files.
    Please tell me how to implement this.
    Thank you for your Service
    Jofin

    Hi Friends
    I just modified my code and tried according to your suggestion. But here it does not print the records inside CSV File. But when i use ResultSet it prints the Records inside the CSV. Now i want to Display only the JTable content.
    I am posting my code here. Please run this code and find the Report.csv file in your current Directory. and please help me to come out of this Problem.
    import javax.swing.*;
    import java.util.*;
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.table.*;
    public class Exporting extends JDialog implements ActionListener
         private JRadioButton rby,rbn,rbr,rbnore,rbnorest;
         private ButtonGroup bg;
         private JPanel exportpanel;
         private JButton btnExpots;
         FileReader reading=null;
         FileWriter writing=null;
         JTable table;
         JScrollPane scroll;
         public Exporting()throws Exception
              setSize(550,450);
              setTitle("Export Results");
              this.setLocation(100,100);
              String Heading[]={"BOOK ID","NAME","AUTHOR","PRICE"};
              String records[][]={{"B0201","JAVA PROGRAMING","JAMES","1234.00"},
                               {"B0202","SERVLET PROGRAMING","GOSLIN","1425.00"},
                               {"B0203","PHP DEVELOPMENT","SUNITHA","123"},
                               {"B0204","PRIAM","SELVI","1354"},
                               {"B0205","JAVA PROGRAMING","JAMES","1234.00"},
                               {"B0206","SERVLET PROGRAMING","GOSLIN","1425.00"},
                               {"B0207","PHP DEVELOPMENT","SUNITHA","123"},
                               {"B0208","PRIAM","SELVI","1354"}};
              btnExpots= new JButton("Export");
              btnExpots.addActionListener(this);
              btnExpots.setBounds(140,200,60,25);
              table = new JTable();
              scroll=new JScrollPane(table);
              ((DefaultTableModel)table.getModel()).setDataVector(records,Heading);
              System.out.println(table.getModel());
              exportpanel= new JPanel();
              exportpanel.add(btnExpots,BorderLayout.SOUTH);
              exportpanel.add(scroll);
              getContentPane().add(exportpanel);
              setVisible(true);
          public void actionPerformed(ActionEvent ae)
              Object obj=ae.getSource();
              try {
              PrintWriter writing= new PrintWriter(new FileWriter("Report.csv"));
              if(obj==btnExpots)
                   for(int row=0;row<table.getRowCount();++row)
                             for(int col=0;col<table.getColumnCount();++col)
                                  Object ob=table.getValueAt(row,col);
                                  //exportApi(ob);
                                  System.out.println(ob);
                                  System.out.println("Connected");
                                  String fieldNames[]={"BOOK ID","NAME","AUTHOR","PRICE"};
                                  String rec = "";
                                  for (int i=0; i <fieldNames.length; i++)
                                       rec +='\"'+fieldNames[i]+'\"';
                                       rec+=",";
                                  if (rec.endsWith(",")) rec=rec.substring(0, (rec.length()-1));
                                  writing.println(rec);
                                  //write values from result set to file
                                   rec +="\""+ob+"\",";     
                                   if (rec.endsWith(",")) rec=rec.substring(0,(rec.length()-1));
                                   writing.println(rec);
                                   writing.close();
         catch(Exception ex)
              ex.printStackTrace();
         public static void main(String arg[]) throws Exception
              Exporting ex= new Exporting();
    }Could anyone Please modify my code and help me out.
    Thank you for your service
    Cheers
    Jofin

  • Customer  Open Interface sample code?

    Hi
    I am trying to import some data (customers) from a legacy
    system into oracle. I would like to use the oracle customer open
    interface but can anyone please give me some sample code how
    they did the import?
    Thank you
    alpha

    Hi
    I am trying to import some data (customers) from a legacy
    system into oracle. I would like to use the oracle customer open
    interface but can anyone please give me some sample code how
    they did the import?
    Thank you
    alpha

  • Sample code for AIMatchingArtSuite::GetSelectedArts() function

    Hello All,
    Could you please write here the sample code how can we use AIMatchingArtSuite::GetSelectedArts( ) function.

    //create the art set and select the arts
    AIArtSet artSet = NULL;
    error = sAIArtSet->NewArtSet(&artSet);
    error = sAIArtSet->SelectedArtSet(artSet);
     if (error) 
    return error;

  • How to Delete a Specific Cell in a Matrix + plz Give sample code for Lost F

    hello there !!!!
    i m in Great Trouble please help me out..
    i have to search for a specific Column n then i have to validate that portion, similarly after validating i have to add update delete all the fuction apply... so please help me i m very upset.
    Public Sub HandleEventts_Allowance(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef EventEnum As SAPbouiCOM.BoEventTypes, ByRef BubbleEvent As Boolean)
            Try
                Dim Count As Int32
                If FormUID.Equals("Allowance") Then
                    If (pVal.BeforeAction = True) And (pVal.ItemUID = "1") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK) Then
                        If pVal.Row = 0 Then
                            'BubbleEvent = False
                        End If
                        o_Matrix = SBO_Application1.Forms.Item(FormUID).Items.Item("MatAllow").Specific
                        Count = o_Matrix.RowCount()
                        SBO_Application1.MessageBox("Matrix Count is " & o_Matrix.RowCount)
                        Validate(pVal, EventEnum, FormUID, BubbleEvent)
                    End If
                End If
            Catch ex As Exception
                SBO_Application1.MessageBox(ex.Message)
            End Try
        End Sub
        Public Sub Validate(ByRef pval As SAPbouiCOM.ItemEvent, ByRef EventEnum As SAPbouiCOM.BoEventTypes, ByVal FormUID As String, ByRef BubbleEvent As Boolean)
            Dim Row, ii As Integer
            o_Matrix = SBO_Application1.Forms.Item(FormUID).Items.Item("MatAllow").Specific
            o_Matrix.FlushToDataSource()
            Try
                For Row = 2 To o_Matrix.RowCount
                    StrName = Convert.ToString(DBtable.GetValue("CardCode", Row - 1)).Trim()''' i got Error over there n rest of my code is also not working pls...
                    StrUId = Convert.ToString(DBtable.GetValue("U_AlwID", Row - 1)).Trim()
                    StrEnter = Convert.ToString(DBtable.GetValue("U_SupEnter", Row - 1)).Trim()
                    StrExist = Convert.ToString(DBtable.GetValue("U_SupExist", Row - 1)).Trim()
                    If Row - 1 < DBtable.Rows.Count - 1 Or (Not (StrName.Equals(String.Empty) And StrUId.Equals(String.Empty) And (StrEnter.Equals(String.Empty) Or StrExist.Equals(String.Empty))) And (Row - 1 = DBtable.Rows.Count - 1)) Then
                        If (Not StrName.Equals(String.Empty)) And ((StrUId.Equals(String.Empty) Or StrEnter.Equals(String.Empty)) Or StrExist.Trim.Equals(String.Empty)) Then
                            SBO_Application1.StatusBar.SetText("Invalid values provided!Blank values not vllowed", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
                            BubbleEvent = False
                            Exit Sub
                        End If
                        For ii = Row To DBtable.Rows.Count - 1
                            If Convert.ToString(DBtable.GetValue("ColName", ii)).Trim().Equals(StrName.Trim()) Then
                                SBO_Application1.StatusBar.SetText("Invalid Allowance ID: Duplication Not Allowed", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
                                oForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE
                                BubbleEvent = False
                                Exit Sub
                            End If
                        Next
                        If CDbl(StrName) < 0 Then
                            SBO_Application1.StatusBar.SetText("Invalid values provided!Blank values not vllowed", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
                            BubbleEvent = False
                            Exit Sub
                        End If
                    End If
                Next Row
            Catch ex As Exception
                SBO_Application1.MessageBox(ex.Message)
            End Try
        End Sub

    Hello there
    sir i want to Add Update and delete these three basic operation onto the Matrix, Sir u game me a Sample code of Delete a specific Column...
    Sir can u do me a favour pls leave every thing n just told me how to update a matrix ,like i have to fill the matrix field through the DATABASE table now i want to update the DataBase table from the matrix..
    i just only know thta i have to fill back database table with the help of FLUSHTODATABASE()
    here is my Sample Code...n i have to update in the validate portion...
    Public Sub HandleEventts_Allowance(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef EventEnum As SAPbouiCOM.BoEventTypes, ByRef BubbleEvent As Boolean)
            Try
                Dim oCellValue As SAPbouiCOM.EditText
                If FormUID.Equals("Allowance") Then
                    If (pVal.ItemUID = "MatAllow") Then
                        If pVal.Row = 0 Then Exit Sub
                        o_Matrix = SBO_Application1.Forms.Item(FormUID).Items.Item("MatAllow").Specific
                        If (pVal.Row > o_Matrix.RowCount) Then Exit Sub
                        oForm = SBO_Application1.Forms.Item(FormUID)
                        If (pVal.ItemUID = "1" Or EventEnum = SAPbouiCOM.BoEventTypes.et_CLICK) Then
                            o_Matrix = SBO_Application1.Forms.Item(FormUID).Items.Item("MatAllow").Specific
                            If pVal.ColUID = "ColName" And pVal.BeforeAction = True Then
                                If pVal.Row = 0 Then Exit Sub
                                oCellValue = CType(o_Matrix.Columns.Item(pVal.ColUID).Cells.Item(pVal.Row).Specific(), SAPbouiCOM.EditText)
                                If (oCellValue.Value.Trim().Equals(String.Empty) And o_Matrix.RowCount <> pVal.Row) Then
                                    SBO_Application1.StatusBar.SetText("Invalid Allowance ID: Blank Value Not Allowed", )
                                    oCellValue.Active = True
                                    BubbleEvent = False
                                    Exit Sub
                                End If
                            End If
                        End If
                    End If
                End If
                Validate(pVal, EventEnum, FormUID, BubbleEvent)
            Catch ex As Exception
                SBO_Application1.MessageBox(ex.Message)
            End Try
        End Sub
    Public Sub Validate(ByRef pval As SAPbouiCOM.ItemEvent, ByRef EventEnum As SAPbouiCOM.BoEventTypes, ByVal FormUID As String, ByRef BubbleEvent As Boolean)
            Dim str, str1 As String
            Dim checkbox1, Checkbox2 As SAPbouiCOM.CheckBox
            Dim o_Matrix As SAPbouiCOM.Matrix
            Dim Sum As Integer
            Dim oRecordset As SAPbobsCOM.Recordset
            Dim Container As Integer
            Dim Count As Int32
            o_Matrix = SBO_Application1.Forms.Item(FormUID).Items.Item("MatAllow").Specific
            oRecordset = o_CompanyObj.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
            Try
                For Count = 0 To DBtable.Rows.Count - 1
                    CodeFill = Convert.ToString(DBtable.GetValue("Name", Count).Trme())
                    NameID = Convert.ToString(DBtable.GetValue("ColUID", Count).Trim())
                    Price = Convert.ToString(DBtable.GetValue("ColPrice", Count).Trim())
                    Quantity = Convert.ToString(DBtable.GetValue("ColQuant", Count).Trim())
                    Total = Convert.ToString(DBtable.GetValue("ColTotal", Count).Trim())
                    checkbox1 = o_Matrix.Columns.Item("ColSEnter").Cells.Item(Count).Specific
                    Checkbox2 = o_Matrix.Columns.Item("ColSExist").Cells.Item(Count).Specific
                    If (checkbox1.Checked = True) And (Checkbox2.Checked = True) Then
                        Dim Sql As String
                        Sql = "Update [@Supplier] Set U_Price=' " & Price & " ',U_ID=" & NameID & "Where Name ='" & CodeFill & " '"
                        oRecordset.DoQuery(Sql)
                    End If
                Next Count
                SBO_Application1.MessageBox("Record was Updated")
            Catch ex As Exception
                SBO_Application1.MessageBox(ex.Message)
            End Try
        End Sub

  • How to run the sample code using the sdk?

    Hi,
    I want to run the jsp code from the enterprize sdk available in the sdn community. Can any one tell me how to execute these jsp sample codes and what is the pre-requisite regarding the set up.
    I already have the deployment ready.
    thanks
    AMar

    Hi Amar,
    To execute samples code, it is same what is required for normal J2EE application.
    Make sure add all the jars to your web application.
    These jars can be found on your BO server installation if windows.
    For BOE XI 3.x
    C:\Program Files\Business Objects\common\4.0\java\lib
    C:\Program Files\Business Objects\common\4.0\java\lib\external
    For BOE XI R2
    C:\Program Files\Business Objects\common\3.5\java\lib
    C:\Program Files\Business Objects\common\3.5\java\lib\external
    Thanks,
    Praveen.

  • Sample code is required on how to use TableUI element in ArrayList

    Hi all
    Can any body send the sample code on how to store Table UI element in Arraylist.
    Regards
    Suresh babu

    Hi I am providing two methods of it. Just go through and try. This will defenately solve your problem
    I. METHOD
    Try This
      //@@begin others
    //this is the array used in the program
      String emp[][]=
           {"nikhil","tapkir","pune"},     
          { "juhi","bhatnagar","delhi"},
      //@@end
    i have to insert the above information in a table wid columns firstname lastname and city .
    u need to use the for loop to insert the data in the table for more than 1 record
    code the following thing in wd init
    here fname lname and city are my value attributes mapped to my table columns.
    for (int i=0;i<emp.length;i++)
           IPrivateTabappView.ITablenodeElement tnode=wdContext.createTablenodeElement();
           tnode.setFname(this.emp<i>[0]);
           tnode.setLname(this.emp<i>[1]);
           tnode.setCity(this.emp<i>[2]);
          wdContext.nodeTablenode().addElement(tnode);
    i hope this is what ur doubt was if not pls clarify.
    hope this helps u.
    II METHOD
    For example: Consider that the value node DataNode having two attributes A and B is bound to the DataSource property of your Table UI Element.
    IDataNodeElement objDataNode = null;
    ArrayList arlDataNode = null;
    int size = 0;
    size = <No. of rows that you want in the table>;
    arlDataNode = new ArrayList();
    for(int i=0;i<size;i++)
    objDataNode = wdContext.createDataNodeElement();
    objDataNode.setA(<Set some values>);
    objDataNode.setB(<Set some values>);
    arlDataNode.add(objDataNode);
    wdContext.nodeDataNode.bind(arlDataNode);
    Hope, You can resolve your problem. Revert me if you have any doubts.
    Regards
    Raghu

  • How to use TreeByKeyTableColumn  (with sample code)

    Hi Guys,
                  Can anyone tell me How to bind data with TreeByKeyTableColumn ? (with sample code). Is it possible to add checkbox with TreeByKeyTableColumn? Kindly aware me further in this regards....
    Thanks,
    Ravin

    Hi
    Answering to following question
    How to bind data with TreeByKeyTableColumn
    Create the Context
    Click on the Context tab of the view. Create a node name it as "AIR_LINES". Set the Cardinality as 0...N. Make it a Singleton Node. Give a method name in supply function column by name "GENERATE_TREE".
    Then we will create attributes required for the tree column. We require 5 attributes
       1. Attribute which contains the current level of the node. Create an attribute called "NODE_LEVEL" of type STRING.
       2. Attribute which contains the parent level of the node. Create an attribute called "PARENT_LEVEL" of type STRING.
       3. Attribute which contains the contents of the node. Create an attribute called "NODE_CONTENT" of type STRING.
       4. Attribute which contains X or Space depending upon the node is expanded or not. Create an attribute called "EXPANDED" of type WDY_BOOLEAN.
       5. Attribute which contains X or Space depending upon the type of the node, whether the node is a branch or a leaf. Create an attribute called "IS_LEAF" of type WDY_BOOLEAN.
    Click on the layout tab of the view. Add UI element of type Table, give the name as 'Tree Table'. Bind the DATASOURCE property of the table to the AIR_LINES node of the view context.
    Give heading to the table as "Booking Details".
    Right click on table node crated and chose Insert Master Column.
    Name it as "TREE_NODE" and chose TreeByKeyTableColumn from the dropdown
    Bind the 4 properties with context attributes we have already created.
    Expanded -> Expanded.
    Is_leaf     -> Is_leaf.
    Parent_key -> Parent_level
    Row_key   -> Node_level
    Give heading to the tree node in the text field.
    Insert a cell editor in the tree column and chose the type as Text view.
    Bind the text property of the text view to the NODE_CONTENT attribute of the context.
    Similarly create a table column to display the second column i.e. Node type.
    Right click -> Insert table column -> Give the heading in the text property of the header (Node Type).
    Right click -> Insert Cell Editor -> Bind the text property to NODE_TYPE attribute of the context.
    Click on the Methods tab of the view. You will find the method of type supply function which we created during the creation of node. Double click and write the following code.
    METHOD generate_tree .
    Ideally this code must go to a method of a class which will return four internal tables
    start of Model code
    TYPES : BEGIN OF ty_scarr,        " Air line Table
             carrid TYPE s_carr_id,
            END OF ty_scarr.
    TYPES : BEGIN OF ty_spfli,        " Flight Connection Table
             carrid TYPE s_carr_id,
             connid TYPE s_conn_id,
            END OF ty_spfli.
    TYPES : BEGIN OF ty_sflight,      " Flight Table
             carrid TYPE s_carr_id,
             connid TYPE s_conn_id,
             fldate TYPE s_date,
            END OF ty_sflight.
    TYPES : BEGIN OF ty_sbook,        " Flight Booking Table
             carrid TYPE s_carr_id,
             connid TYPE s_conn_id,
             fldate TYPE s_date,
             bookid TYPE s_book_id,
            END OF ty_sbook.
    DATA : lt_scarr TYPE TABLE OF ty_scarr.
    DATA : lt_spfli TYPE TABLE OF ty_spfli.
    DATA : lt_sflight TYPE TABLE OF ty_sflight.
    DATA : lt_sbook TYPE TABLE OF ty_sbook.
    DATA : ls_scarr TYPE  ty_scarr.
    DATA : ls_spfli TYPE  ty_spfli.
    DATA : ls_sflight TYPE ty_sflight.
    DATA : ls_sbook TYPE  ty_sbook.
    SELECT carrid
      FROM scarr
      INTO TABLE lt_scarr
      UP TO 2 ROWS.
    IF lt_scarr[] IS NOT INITIAL.
      SELECT carrid connid
        FROM spfli
        INTO TABLE lt_spfli
        FOR ALL ENTRIES IN lt_scarr
        WHERE carrid EQ lt_scarr-carrid.
        IF lt_spfli[] IS NOT INITIAL.
          SELECT carrid connid fldate
            FROM sflight
            INTO TABLE lt_sflight
            FOR ALL ENTRIES IN lt_spfli
            WHERE carrid EQ lt_spfli-carrid
            AND connid EQ lt_spfli-connid.
    For an additional level of branching
           IF lt_spfli[] IS NOT INITIAL.
               SELECT carrid connid fldate bookid
                 FROM sbook
                 INTO TABLE lt_sbook
                 FOR ALL ENTRIES IN lt_sflight
                 WHERE carrid EQ lt_sflight-carrid
                 AND connid EQ lt_sflight-connid
                 AND fldate EQ lt_sflight-fldate.
           ENDIF.
        ENDIF.
    ENDIF.
    End of Model code
    Start of code for generation the tree
    data declaration
      DATA lt_table TYPE wd_this->elements_air_lines.
      DATA ls_table LIKE LINE OF lt_table.
      DATA lvl1_index TYPE string.
      DATA lvl2_index TYPE string.
      DATA lvl3_index TYPE string.
      DATA lvl4_index TYPE string.
    Level 1
    LOOP AT lt_scarr INTO ls_scarr.
      lvl1_index = sy-tabix.
      condense lvl1_index.
      create a row
        ls_table-node_level       = lvl1_index.     " 1 st level
        ls_table-parent_level     = ''.             " No parent
        ls_table-node_content     = ls_scarr-carrid.
        ls_table-node_type        = 'Air Line'.
        ls_table-is_leaf          = abap_false.
        INSERT ls_table INTO TABLE lt_table.
        clear ls_table.
    Level 2
    LOOP AT lt_spfli INTO ls_spfli.
      lvl2_index = sy-tabix.
      condense lvl2_index.
      create a row
        concatenate lvl1_index `.` lvl2_index into ls_table-node_level.
        ls_table-parent_level     = lvl1_index.     " Parent 1 st level
        ls_table-node_content     = ls_spfli-connid.
        ls_table-node_type        = 'Flight Connection'.
        ls_table-is_leaf          = abap_false.
        INSERT ls_table INTO TABLE lt_table.
        clear ls_table.
    Level 3
    LOOP AT lt_sflight INTO ls_sflight.
      lvl3_index = sy-tabix.
      condense lvl3_index.
      create a row
        concatenate lvl1_index `.` lvl2_index `.` lvl3_index into ls_table-node_level.
        concatenate lvl1_index `.` lvl2_index into ls_table-parent_level.
        ls_table-node_content     = ls_sflight-fldate.
        ls_table-node_type        = 'Flight'.
        ls_table-is_leaf          = abap_true.
        INSERT ls_table INTO TABLE lt_table.
        clear ls_table.
    If you want an additional level it can be programmed like this
    Level 4
    *LOOP AT lt_sbook INTO ls_sbook.
    lvl4_index = sy-tabix.
    condense lvl4_index.
      create a row
       concatenate lvl1_index `.` lvl2_index `.` lvl3_index `.` lvl4_index into ls_table-node_level.
       concatenate lvl1_index `.` lvl2_index `.` lvl3_index into ls_table-parent_level.
       ls_table-node_content     = ls_sbook-bookid.
       ls_table-node_type        = 'Booking'.
       ls_table-is_leaf          = abap_true.      " as its the final level in our hier archy
       INSERT ls_table INTO TABLE lt_table.
    ENDLOOP.
    ENDLOOP.
    ENDLOOP.
    ENDLOOP.
    bind all the elements
      node->bind_table(
        new_items            =  lt_table
        set_initial_elements = abap_true ).
    ENDMETHOD.

  • How-To/Sample code to tie up class variable to MXML component created in Design view

    This is a very noob question but I've been searching through the documentation for the last 2 hours and can't seem to find anything helpful.  I have a SWFLoader created in the design view.  I have all my app code in an <fx:Script> with all my functions and variable in a CDATA tag.  All I want to do is hookup the SWFLoader created in the design view with a private var in my ActionScript. 
    I also have two separate states for my app, and I want the same SWFLoader to be visible in both states. Can someone point me to some useful sample code or documentation??
    Any help is much appreciated.

    Sun has recommendations for naming conventions. Class names should start with a capital letter. You should avoid using class names that are the same as classes provided in the SDK. Following these conventions will make it easier for people to help you. For example, you should not use file, nor should you use File. It's better to use MyFile, replacing My with something that makes sense to your application (SeniorFile?).
    Also, check the Formatting Help link when posting for a desciption on how to use the code tags for posting code.
    1. You need to establish references between your classes. One way is to have a constructor that has a JMenuBar argument.
    2. You can not add a file to a JMenuBar because a JMenuBar adds a JMenu. I don't think you want file to extend JMenu. It may be better for file to have a JMenu.
    I haven't tried to compile this code so no guarantees - just trying to show you an approach.
    public class Senior extends JFrame {
       public Senior() {
          JMenuBar bar = new JMenuBar();
          MyFile file = new MyFile(bar);
    //whatever else you need
    public class MyFile {
       public MyFile(JMenuBar mbar) {
          JMenu menu = new JMenu();
          mbar.add(menu);

  • How to create a database for sample code from Tutorial/Book?

    I want to try out the sample code from [http://shop.oreilly.com/product/0636920013471.do] for the book SQL Pocket Guide 3rd Ed.
    I have downloaded the oracle vm/appliance for oracle 11g2 and I have started sqlplus as sysdba.
    I'm feeling overwhelmed with these links describing how to create a database:
    [http://www.adp-gmbh.ch/ora/admin/creatingdbmanually.html]
    [http://tldp.org/HOWTO/Oracle-7-HOWTO-3.html]
    [http://www.adp-gmbh.ch/ora/admin/creatingdbmanually.html]
    (1) What is the command to list the existing databases?
    (2) What is the command to delete an existing database?
    (3) When creating a new database with the create database command, is it necessary to specify the logfile, character set, national character set, datafile, sysaux datafile, undo tablespace, temp table space? Do these have reasonable defaults? I'm not sure what proper directories are to specify for Linux and the examples are for windows.
    Can someone give me a simplified create database command to create a database called 3rdEdPocketGuide? Should I follow the example at [http://tldp.org/HOWTO/Oracle-7-HOWTO-3.html] and instead of orcl use 3rdEdPocketGuide?
    (4) What command do I use to execute the script that comes with the book SQL Pocket Guide 3rd Ed? This is the script that has all the drop table, create table and insert commands in it.
    (5) What command do I use in sqlplus to set the current default database prior to running this script? Perhaps this is the connect command? I don't want my script to create tables in the system database.
    (6) I tried the command "connect 3rdEdPocketGuide" and it prompted for a password! Yikes! What password? Do I need to specify a password when I create a database? I cannot tell if I have successfully created such a database or it is just prompting me for a password to thwart malicious users. Is it is possible to create databases which don't require a password or maybe a zero length password?
    Thanks
    Siegfried
    Edited by: user8816970 on Sep 26, 2012 12:01 PM
    Edited by: user8816970 on Sep 26, 2012 12:18 PM

    user8816970 wrote:
    Paul,
    Thanks! I tried changing my profile name to siegfried but I'm not seeing the change...
    Anyway, I'm trying your suggestion to use SQL Developer which was already installed in the virtual box appliance and I cannot figure out how to get a connection.
    When I use the defaults of sid=xe, port=1521, hostname=localhost and specify
    username=sysdba
    password=
    I get status: failure - test failed: listener refursed connection with the following error: ORA 12505, TNS: listener does not current know of sid given.
    So I try sid=orcl and that works better: status: failure - test failed: ORA-01017: invalid username/passowrd; login denied
    OK, sqlplus let me in with out a password, why does not this work?
    So I try checking the box for "OS Authentication" and I get the same error!
    Hoek: I tried searching the documentation and found "3 Exploring Oracle Database with SQL Developer" at http://docs.oracle.com/cd/E11882_01/appdev.112/e10766/toc.htm but following those directions did not help. Can you be more specific? The directions were for a tutorial and I need to know what the passwords are for the database set up with [http://www.oracle.com/technetwork/database/enterprise-edition/databaseappdev-vm-161299.html|http://www.oracle.com/technetwork/database/enterprise-edition/databaseappdev-vm-161299.html] . I also found [http://docs.oracle.com/cd/E11882_01/appdev.112/e10766/tdddg_connecting.htm#CEGHFHIG|http://docs.oracle.com/cd/E11882_01/appdev.112/e10766/tdddg_connecting.htm#CEGHFHIG] but that did not help either.
    Everyone:
    Do I need to create a user using SQL*Plus first so I can login with "Oracle SQL Developer" so I create my database called? What would be the "create user" command I would execute?
    OK, so I run sqlplus and issue these commands
    create user siegfried identified by abc ;
    grant connect to siegfried ;
    connect siegfried/abc;
    Now, how do I create a database? In Microsoft SQL Server one has to create a database first and if you just start creating tables without creating a database first, the tables will be created in the system database and this is usually undesirable.
    Sometimes a database is known in the java connection string as the catalog. Is there any such analog in oracle SQL plus?
    So now what do I do? I want to create a bunch of tables using my script I downloaded from 3rd Ed SQL Pocket Guide. Does my new user "siegfried" have the right to create tables? I guess I could try but I don't want to create tables in the system database.
    I noticed I can also use "Oracle SQL Developer" to connect with my new "siegfried" account. It seems that I should have been able to connect with sysdba... strange.
    So now I am connected in the "Oracle SQL Developer" and I see no list of databases.
    Thanks!
    Siegfried
    >Paul,
    Thanks! I tried changing my profile name to siegfried but I'm not seeing the change...
    Anyway, I'm trying your suggestion to use SQL Developer which was already installed in the virtual box appliance and I cannot figure out how to get a connection.
    When I use the defaults of sid=xe, port=1521, hostname=localhost and specify
    username=sysdba
    password=
    I get status: failure - test failed: listener refursed connection with the following error: ORA 12505, TNS: listener does not current know of sid given.
    So I try sid=orcl and that works better: status: failure - test failed: ORA-01017: invalid username/passowrd; login denied
    OK, sqlplus let me in with out a password, why does not this work?
    So I try checking the box for "OS Authentication" and I get the same error!
    Hoek: I tried searching the documentation and found "3 Exploring Oracle Database with SQL Developer" at http://docs.oracle.com/cd/E11882_01/appdev.112/e10766/toc.htm but following those directions did not help. Can you be more specific? The directions were for a tutorial and I need to know what the passwords are for the database set up with [http://www.oracle.com/technetwork/database/enterprise-edition/databaseappdev-vm-161299.html|http://www.oracle.com/technetwork/database/enterprise-edition/databaseappdev-vm-161299.html] . I also found [http://docs.oracle.com/cd/E11882_01/appdev.112/e10766/tdddg_connecting.htm#CEGHFHIG|http://docs.oracle.com/cd/E11882_01/appdev.112/e10766/tdddg_connecting.htm#CEGHFHIG] but that did not help either.
    Everyone:
    Do I need to create a user using SQL*Plus first so I can login with "Oracle SQL Developer" so I create my database called? What would be the "create user" command I would execute?
    OK, so I run sqlplus and issue these commands
    create user siegfried identified by abc ;
    grant connect to siegfried ;
    connect siegfried/abc;
    above does NOT use SQL*Net to connect to the instance
    >
    Now, how do I create a database? In Microsoft SQL Server one has to create a database first and if you just start creating tables without creating a database first, the tables will be created in the system database and this is usually undesirable.
    Sometimes a database is known in the java connection string as the catalog. Is there any such analog in oracle SQL plus?
    So now what do I do? I want to create a bunch of tables using my script I downloaded from 3rd Ed SQL Pocket Guide. Does my new user "siegfried" have the right to create tables? I guess I could try but I don't want to create tables in the system database.
    I noticed I can also use "Oracle SQL Developer" to connect with my new "siegfried" account. It seems that I should have been able to connect with sysdba... strange.
    So now I am connected in the "Oracle SQL Developer" and I see no list of databases.SQL Developer can only connect to the instance via SQL*Net
    >
    Thanks!
    Siegfrieda database in SQL Server is same as schema/user in Oracle

  • How to create the Sap script & Layout Set (wants sample code)

    Hi All ,
    Can you please provide me the step by step procedure
    to create the Sap script & Layout Set .(please provide sample
    code/links /docs for layout & print program).
    Regards
    Rahul

    hi,
    go through the following links  what i found to create sap script.
    http://www.thespot4sap.com/Articles/SAPscript_Introduction.asp
    http://abapliveinfo.blogspot.com/2008/01/free-sapscript-made-easy-46-book.html
    http://www.thespot4sap.com/articles/SAPscript_example_code.asp
    http://idocs.de/www3/cookbooks/sapscript/sapscript_1/docu.htm
    http://idocguru.com/www5/cookbooks/sapscript/sapscript_1/example.htm
    www.geocities.com/wardaguilar25/sapscript-tutorial.html
    http://logosworld.de/www3/cookbooks/sapscript/sapscript_8/docu.htm
    how to create a  scripts?give steps?
    https://forums.sdn.sap.com/click.jspa?searchID=1811669&messageID=2969311
    https://forums.sdn.sap.com/click.jspa?searchID=1811669&messageID=2902391
    https://forums.sdn.sap.com/click.jspa?searchID=1811669&messageID=3205653
    https://forums.sdn.sap.com/click.jspa?searchID=1811669&messageID=3111402
    http://www.sap-img.com/sapscripts.htm
    http://sappoint.com/abap/
    http://www.henrikfrank.dk/abapexamples/SapScript/sapscript.htm
    http://help.sap.com/saphelp_crm40/helpdata/en/16/c832857cc111d686e0000086568e5f/content.htm
    http://www.sap-basis-abap.com/sapabap01.htm
    http://www.sap-img.com/sapscripts.htm
    http://searchsap.techtarget.com/tip/1,289483,sid21_gci943419,00.html
    http://sap.ittoolbox.com/topics/t.asp?t=303&p=452&h2=452&h1=303
    http://www.sapgenie.com/phpBB2/viewtopic.php?t=14007&sid=09eec5147a0dbeee1b5edd21af8ebc6a
    Other Links

  • How to add data into JTable

    How can I add data into JTable, for instance ("Mike", "Gooler", 21).

    How can I add data into JTable, for instance ("Mike",
    "Gooler", 21).You will have very good results if you segregate out the table model as a seperate user class and provide a method to add a row there. In fact, if you use the table to reflect a database table you can add the row inplace using the existing cursor. I believe it's TableExample2 in the jdk\demo\jfc\TableExamples that has a very good example of this.
    Walt

  • How to put JComboBox in JTable?

    I'm trying to put JComboBox in JTable, the following is my table model. The problem is that it doesn't display a JComboBox but a string of it, something like "MyTableModel$JComboBox....". Any help would be appreciated.
    class MyModel extends AbstractTableModel {
    String[] columnNames = {"Column One", "Column One"};
    String[] boxItem = {"Item One", "Item Two"};
    String[] rows = {"Row One", "Row Two"};
    JComboBox[] boxes = {
    new JComboBox(boxItem),
    new JComboBox(boxItem)
    Object[][] data = new Object[][]{rows, boxes};
    public Object getValueAt(int row, int col) {
    return data[col][row];
    }

    Hi,
    the TableModel is the wrong place to put the combo box. A model is just a representation for the data displayed in the table.
    A combo box, on the other hand, is a certain way for the user to edit the values in the table (and in the model). To change the way a user edits in a table you have to set the TableCellEditor. You can do this for the whole table or for a certain column.
    // in the JTable's constructor or init method
    // to set JComboBox in 2nd column
    // get 2nd column
    TableColumn column = myTable.getColumnModel().getColumn(1);
    // create combo box
    JComboBox combo = new JComboBox();
    combo.add("ItemOne");
    combo.add("ItemTwo");
    // set as editor for the column
    DefaultCellEditor editor = new DefaultCellEditor(combo);
    column.setCellEditor(editor);This is just an example. Try it w/ a simple table.

Maybe you are looking for

  • IPhone calendar / weekly view and yearly view

    Good afternoon, I am supporting business users on different models of iPhones. The calendar function can display days and months but not weeks and years. Is there any way that this function can be enabled or is that not part of the software? A lot of

  • Javax.mail CSV file attachment corrupt?

    I'm having some trouble with attaching a file to an outgoing email, it's a CSV file and when it is uploaded/attached to the email, it becomes "corrupt". Excel will still open it but if I open it in notepad the formatting is noticeably messed up. I ne

  • 2011 iMac missing mini display port?

    I'm trying to connect my 2011 iMac to an additional display using the mini display to DVI, but my computer doesn't have a mini display port I can't seem to find this info anywhere. What kind of adapter do I need?

  • Message no. AG021 when doing component availabilty check,

    Hi PP Gurus, When I'm trying to do Availability check for Planned order (order type PE) getting an error 'No control data maintained for checking group 02 and checking rule' (Message no. AG021) though Availability checking control for order type PP01

  • Where has my CD player gone?

    Hi, I've been recently getting this message after i log on my emac. The message reads, "You have inserted a disk containing no volumns that Mac OS X can read. To continue with the disk inserted click ignore." I click ignore and I don't get anything.