How to add a place holder dynamically at run time

Hi All,
is it possible to add a site studio place holder dynamically at run time?
Thanks
~hari

Yes, it should be possible in the Design Mode. See http://docs.oracle.com/cd/E21764_01/doc.1111/e10611/c02_getting_started.htm#CIHCDGIB

Similar Messages

  • How to add a checkbox to dynamic itab  so that i can select some records

    How to add a checkbox to dynamic itab  so that i can select some records in the alv and can display them in another alv using a button
    I have requirement where i have to display the dynamic itab records in an alv ....Some records from this alv output has to be selected through checkbox  provided in the first column .( I will get to know the structure of the itab only at runtime ,so iam using dynamic itab)

    Hi,
       I tried and finally i got it , Just try for it.
    type-pools : slis.
    PARAMETERS : p_tab type dd02l-tabname.
    data : ref_tabletype  type REF TO cl_abap_tabledescr,
           ref_rowtype TYPE REF TO cl_abap_structdescr.
    field-symbols  : <lt_table>  type   standard TABLE ,
           <fwa> type any,
           <field> type abap_compdescr.
    data : lt_fcat type lvc_t_fcat,
           ls_fcat type lvc_s_fcat,
           lt_fldcat type SLIS_T_FIELDCAT_ALV,
           ls_fldcat like line of lt_fldcat.
    data : ref_data type REF TO data,
            ref_wa type ref to  data.
    ref_rowtype ?= cl_abap_typedescr=>DESCRIBE_BY_name( p_name = p_tab ).
    TRY.
    CALL METHOD cl_abap_tabledescr=>create
      EXPORTING
        p_line_type  = ref_rowtype
      receiving
        p_result     = ref_tabletype.
    CATCH cx_sy_table_creation .
    write : / 'Object Not Found'.
    ENDTRY.
    *creating object.
    create data ref_data type handle ref_tabletype.
    create data ref_wa type handle ref_rowtype.
    *value assignment.
    ASSIGN ref_data->* to <lt_table>.
    assign ref_wa->* to <fwa>.
    loop at ref_rowtype->components ASSIGNING <field>.
      ls_fcat-fieldname = <field>-name.
      ls_fcat-ref_table = p_tab.
      append ls_fcat to lt_fcat.
    if lt_fldcat[] is  INITIAL.
        ls_fldcat-fieldname = 'CHECKBOX'.
        ls_fldcat-checkbox = 'X'.
        ls_fldcat-edit = 'X'.
        ls_fldcat-seltext_m = 'Checkbox'.
        append ls_fldcat to lt_fldcat.
      endif.
      clear ls_fldcat.
      ls_fldcat-fieldname = <field>-name.
      ls_fldcat-ref_tabname = p_tab.
      append ls_fldcat to lt_fldcat.
    endloop.
    loop at lt_fldcat into ls_fldcat.
      if sy-tabix = 1.
        ls_fldcat-checkbox = 'X'.
        ls_fldcat-edit = 'X'.
    modify lt_fldcat FROM ls_fldcat
        TRANSPORTING checkbox edit.
    endif.
    endloop.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
      EXPORTING
        it_fieldcatalog           = lt_fcat[]
      IMPORTING
        ep_table                  = ref_data.
    assign ref_data->* to <lt_table>.
    select * FROM (p_tab) into table <lt_table>.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       IT_FIELDCAT                       = lt_fldcat[]
      TABLES
        t_outtab                          = <lt_table>.
    Thanks & Regards,
    Raghunadh .K

  • Change the source of place holder dynamically in report

    Hi,
    We need to assign values to place holder dynamically in report pages based on the page number.
    Basic requirement is to have dynamic images (generated in before report trigger with file name having timestamp and page number) in dynamic pages (getting repeated based on number of lines in the report).
    Is there any way we can have a place holder mapped to this field (Read from file, type: Image) and change the source dynamically when each page is formatted?
    Any pointers for this will be helpful.
    Thanks,
    Ayyappa

    Hi,
    We need to assign values to place holder dynamically in report pages based on the page number.
    Basic requirement is to have dynamic images (generated in before report trigger with file name having timestamp and page number) in dynamic pages (getting repeated based on number of lines in the report).
    Is there any way we can have a place holder mapped to this field (Read from file, type: Image) and change the source dynamically when each page is formatted?
    Any pointers for this will be helpful.
    Thanks,
    Ayyappa

  • How to add new field into dynamic internal table

    Hello Expert.
    how to add new field into dynamic internal table.
    PARAMETERS: P_TABLE(30).    "table name
    DATA: I_TAB TYPE REF TO DATA.
    FIELD-SYMBOLS: <TAB> TYPE standard TABLE.
    *Create dynamic FS
    create DATA I_TAB TYPE TABLE OF (p_table).
      ASSIGN I_TAB->* TO <TAB>.
    SELECT * FROM (p_table) INTO TABLE <TAB>.
       here i want to add one more field into <TAB> at LAST position and my 
       Field name  =  field_stype     and
       Field type    =  'LVC_T_STYL'
    could you please helpme out .

    Hi,
    Please find the code below.You can add the field acc to your requirement.
    Creating Dynamic internal table
    TYPE-POOLS: slis.
    FIELD-SYMBOLS: <t_dyntable> TYPE STANDARD TABLE,  u201C Dynamic internal table name
                   <fs_dyntable>,                     u201C Field symbol to create work area
                   <fs_fldval> type any.              u201C Field symbol to assign values 
    PARAMETERS: p_cols(5) TYPE c.                     u201C Input number of columns
    DATA:   t_newtable TYPE REF TO data,
            t_newline  TYPE REF TO data,
            t_fldcat   TYPE slis_t_fldcat_alv,
            t_fldcat   TYPE lvc_t_fcat,
            wa_it_fldcat TYPE lvc_s_fcat,
            wa_colno(2) TYPE n,
            wa_flname(5) TYPE c. 
    Create fields .
      DO p_cols TIMES.
        CLEAR wa_it_fldcat.
        move sy-index to wa_colno.
        concatenate 'COL'
                    wa_colno
               into wa_flname.
        wa_it_fldcat-fieldname = wa_flname.
        wa_it_fldcat-datatype = 'CHAR'.
        wa_it_fldcat-intlen = 10.
        APPEND wa_it_fldcat TO t_fldcat.
      ENDDO. 
    Create dynamic internal table and assign to FS
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = t_fldcat
        IMPORTING
          ep_table        = t_newtable. 
      ASSIGN t_newtable->* TO <t_dyntable>. 
    Create dynamic work area and assign to FS
      CREATE DATA t_newline LIKE LINE OF <t_dyntable>.
      ASSIGN t_newline->* TO <fs_dyntable>.
    Populating Dynamic internal table 
      DATA: fieldname(20) TYPE c.
      DATA: fieldvalue(10) TYPE c.
      DATA: index(3) TYPE c. 
      DO p_cols TIMES. 
        index = sy-index.
        MOVE sy-index TO wa_colno.
        CONCATENATE 'COL'
                    wa_colno
               INTO wa_flname. 
    Set up fieldvalue
        CONCATENATE 'VALUE' index INTO
                    fieldvalue.
        CONDENSE    fieldvalue NO-GAPS. 
        ASSIGN COMPONENT  wa_flname
            OF STRUCTURE <fs_dyntable> TO <fs_fldval>.
        <fs_fldval> =  fieldvalue. 
      ENDDO. 
    Append to the dynamic internal table
      APPEND <fs_dyntable> TO <t_dyntable>.
    Displaying dynamic internal table using Grid. 
    DATA: wa_cat LIKE LINE OF fs_fldcat. 
      DO p_cols TIMES.
        CLEAR wa_cat.
        MOVE sy-index TO wa_colno.
        CONCATENATE 'COL'
                    wa_colno
               INTO wa_flname. 
        wa_cat-fieldname = wa_flname.
        wa_cat-seltext_s = wa_flname.
        wa_cat-outputlen = '10'.
        APPEND wa_cat TO fs_fldcat.
      ENDDO. 
    Call ABAP List Viewer (ALV)
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          it_fieldcat = fs_fldcat
        TABLES
          t_outtab    = <t_dyntable>.

  • How can i update data in JTable at run time ?

    i am trying to build a client/server architecture for conducting quizzes & online tests.. My client will return a object to the server after the test is over, which contains details about the participant, his score and other details. i am putting the incoming object to an Vector. I'll create a new thread each time for the incoming connection and insert the object to the Vector.. Now, please tell me tat, how can i update my table automatically at run time so tat, my table is updated whenever a new object is entered into vector..
    here is my code for the table..
    public class MyTableModel extends AbstractTableModel {
        String columNames[] = { "ID", "NAME", "COLLEGE", "SCORE", "CELL" };
        /** Creates a new instance of MyTableModel */
        public MyTableModel() {
            Main.List = new Vector();
            SetDefaultData();
        public int getRowCount() {
            return Main.List == null ? 0 : Main.List.size();
        public int getColumnCount() {
            return columNames.length;
        public String getColumnName(int column) {
            return columNames[column];
        public boolean isCellEditable(int row,int col) {
            return false;
        public Object getValueAt(int rowindex, int columnindex) {
            if(rowindex < 0 || rowindex >= getRowCount())
                return "";
            Student row = (Student)Main.List.elementAt(rowindex);
            switch (columnindex)
                case 0 : return row.id;
                case 1 : return row.name;
                case 2 : return row.college;
                case 3 : return row.score;
                case 4 : return row.cell;
            return "";
        public String getTitle() {
            return "Student Table";
        private void SetDefaultData() {
            Main.List.removeAllElements();
            Main.List.addElement(new Student("CS041","Keerthivasan M","MNM",95,"9884326321"));
            Main.List.addElement(new Student("CS012","Arun M","MNM",90,"9884825780"));
            Main.List.addElement(new Student("CS019","Balaji S","MNM",79,"9841742068"));
            Main.List.addElement(new Student("CS005","Anand R","MNM",89,"9884130727"));
            Main.List.addElement(new Student("CS045","Manish J","MNM",55,"9841624625"));
            Main.List.addElement(new Student("CS013","Mangal S","MNM",5,"9841961742"));
    }

    In the future Swing related questions should be posted in the Swing forum.
    how can i update my table automatically at run time so tat, my table is
    updated whenever a new object is entered into vector..You don't update the Vector directly. You should be creating a method in your TableModel, called "addRow(...)". This method will do two things:
    a) add the Student object to the Vector
    b) invoke the fireTableRowsInserted(..) method of AbstractTableModel. This will cause the table to be repainted.

  • How can i see Log information of Report Run Time?

    Hi Gurus,
    How can i see Log information of Report Run Time?, till now i am counted report run time manually. Is there any way i can see the workbook running time in log information?.
    Thanks & Regards
    Vikram

    There could be a few things -
    At one time, you needed to run a separate script to create the tables. I'm not sure that is still the case. If you check the Administrators guide, look into the chapter that deals with the EUL Status Workbooks.
    If you are not logged on as the eul owner, you may not have select privileges, or you may need to qualify the table with the schema (if there is no synonym) - select * from <eul_owner>.EUL5_QPP_STATS;
    If you are on 4i, the table is EUL4_QPP_STATS

  • How We Can Change Page Size During Report Run Time

    Hello !
    How We Can Change Page Size During Report Run Time .
    How can we stop to change the column name when we amend a sql in report data model.
    Thanks !
    null

    hello sohail
    1. question - i'm afraid this cannot be done ... bit in report 6 and newer you have posibility to divide your report in 3 parts (former header, body, trailor) and each part can have diferent page siz, orientation , ...
    2. question - best is give each column in your statements in one report diferent alias. when you have to chnge something, alias will remain same ...
    try this: select 1 as fist_column, 1 as second_column from dual
    hope this helsp

  • How to drag and drop a picture at run time in a window displaying pictures?

    How to drag and drop a picture at run time in a window displaying pictures on the front panel. The main thing is that the window is displaying frames continuously?

    vivman,
    So from your description you have a picture control where you've already created an image and you'd like to drag an image around inside of the picture control. This can be done although it is going to take a significant amount of research and programming on your behalf. You can use the drag event in the event handler to find out when the drag occurs and where the cursor is. Then edit the picture as you move your mouse so that when you drop the picture gets updated.
    The even structure is a somewhat advanced topic and the drag and drop feature is one of the more advanced uses of this structure. I would search the example finder (help>>find examples) for "event" and "drag" to see how to use these events. Also you'll want to look at the examples for the picture control.
    Sounds like a cool project! Check out Darren's Weekly Nugget 10/30/2006 this topic (http://forums.ni.com/ni/board/message?board.id=170&message.id=212920). It might prove useful.
    Good luck!
    Chris C
    Chris Cilino
    National Instruments
    LabVIEW Product Marketing Manager
    Certified LabVIEW Architect

  • How to add Select event in dynamic ALV

    Hi,
    I have created dynamic ALV and now i want to checked the selected row value.
    If in the selected row contain 'A' value then i have to disable the Button given on the screen.
    If in the selected row contain B' value then i have to enable the Button given on the screen.
    How to add the event once I select the row.
    I have done like this . but it is not
    lw_api_2->do_dynamic_navigation(
              source_window_name          = 'ZWDCHHR_EX_TASK_DELE'
              source_vusage_name          = 'ZWDVHHR_EX_TASK_DELE_USAGE_1'
              source_plug_name            = 'TO_ALV'
              target_component_name       = 'SALV_WD_TABLE'
              target_component_usage      = 'ALV_USAGE1'
              target_view_name            = 'TABLE'
              target_plug_name            = 'DEFAULT'
              target_embedding_position   = 'ZWDVHHR_EX_TASK_DELE/VIEW_DELEG_MY_TASKS' ).
      register event handler
        lw_cmp_usage_2->add_event_handler(
           listener        =  lw_api_2
           handler_name    = 'ONSELECT_TAB1'
           controller_name = 'INTERFACECONTROLLER'
           event_name      = 'ON_SELECT' ).
    Thanks and regards
    Amita Gandhi

    Hi Amita,
    You can try fetch the number of the row which was leadselected through R_PARAM->INDEX. (This would be just a normal integer variable. You can try check this out in debugging mode. ) Now you can just read the data of this row from the context node by saying as GET_ATTRIBUTE up on the nodes reference with the index as R_PARAM->INDEX.
    Regards,
    Uday

  • How can i add rows to a JTable at run time ??????

    hi there
    how can i add a row to a JTable at run time? and display the table after the change? thank you.

    For adding or removing the rows from the JTable, you have to use the methods on the table model. I would show you a simple implementation of table model.
    public class MyTableModel extends AbstractTableModel {
    private ArrayList rowsList = null;
    private String [] columns = { "Column 1" , "Column 2", "Column 3"};
    public MyTableModel() {
    rowsList = new ArrayList();
    public int getRowCount() {
    return rowsList.size();
    public int getColumnCount() {
    return columns.length;
    public void addRow(MyRow myRow) {
    //MyRow is any of your object.
    rowsList.add(myRow);
    fireTableDataChanged();
    public void removeRow(int rowIndex) {
    rowsList.remove(rowIndex);
    fireTableRowsDeleted(rowIndex, rowIndex);
    public Object getValueAt(int row, in col) {
    MyRow currentRow = (MyRow)rowsList.get(row);
    switch (col) {
    case 0:
    //return the value of first cell
    break;
    case 1 :
    //return the value of second cell
    break;
    case 2 :
    //return the value of third cell
    break;
    }Then create the table using the TableModel using the constructor new JTable(TableModel) and then when you want to add/remove a row from the table, call myTableModel.addRow(MyRow) or myTableModel.removeRow(rowIndex)....I hope that this solves your problem.

  • How to Add Album Art to Multiple Songs Same Time?

    I have many scenarios where 60-70 songs will share the same imported album art. Is there a method to add the art to the bulk of songs all at the same time. Similar to the multiple item entry field?
    Thanks!

    Is there a method to add the art to the bulk of songs all at the same time. Similar to the multiple item entry field?
    You do it exactlky the same.
    Select all teh songs you want, right click - get info.
    Tick the box next to Artwork and drag or paste artwork into the box.
    -> iTunes: How to add artwork to songs and videos in your library

  • How to add titles to multiple pictures at same time in iphoto11

    I am having difficulty navigating in iphoto11.
    Can not figure out how to add keywords to multiple photos
    or how to add the same title to multiple photos.

    Titles: Photos menu -> Batch Change.
    Keywords: Select a batch of pics. Apply keyword to one, it's applied to all
    Regards
    TD

  • How to make a text field required at run time when the user clicks the checkbox ?

    I got a form where , there are several checkboxes and text fields associated with that checkboxes.If the use clicks on the check box then the associated
    text fields should become required.I have tried the change event and the click event for the checkboxes.It gives error in the onChnage event and I got some weird results in the on click event .Sometimes if the user click the check box , then for the 1st time the field doesnt become required , then the user onclicks the check box and when the user clicks the checkbox for the second time the field becomes required,but if i deselects the highlighted field option and selects it again the field becomes required even if the user onchecks it I am totally confused !!! Adding to it i have also written the wrong code still i achieved the desired result ?? How it can be possible . I am writing the codes below , please help me as i am working under a deadline from the client.
    onChange event :
    var newVal = this.boundItem(xfa.event.newText);
    if(newVal == 0)
        xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.Purchasecost3_1" ).validate.nullTest = "disabled";
      else
         xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.Purchasecost3_1" ).validate.nullTest = "error";
    For the onClick event :
    var a = xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row2.CostItemRecovere d_OnlyEnergyCharges").rawValue;
    //app.alert(a);
    if(a == 0)
        xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L1_1").validate.nullTest = "error";
      if(a == 1)
          xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L1_1").validate.nullTest = "disabled";
       Please help someone !!!

    I used the onchange event and wrote the code for it. I got the result . But there is a problem.All these fields are in a table and it's a dynamic table where you can add rows dynamically at the run time .I have other change event for some fields in this table .All are working fine when i add the row.But for this check box the required fields are not validated as required at the run time . I am here giving the code , Please help me .
    form1.Subform0.Subform1.Subform9.Subform10.Table48.Row2.CostItemRecovered_OnlyEnergyCharge s::change - (JavaScript, client)
    if(this.rawValue == "1")
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L1_1").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L2_1").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row5.ComplianceCheck_ L1_2").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row5.ComplianceCheck_ L2_2").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row6.ComplianceCheck_ L1_3").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row6.ComplianceCheck_ L2_3").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row7.ComplianceCheck_ L1_4").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row7.ComplianceCheck_ L2_4").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row8.ComplianceCheck_ L1_5").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row8.ComplianceCheck_ L2_5").mandatory= "error";
    else
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L1_1").mandator = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L2_1").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row5.ComplianceCheck_ L1_2").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row5.ComplianceCheck_ L2_2").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row6.ComplianceCheck_ L1_3").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row6.ComplianceCheck_ L2_3").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row7.ComplianceCheck_ L1_4").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row7.ComplianceCheck_ L2_4").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row8.ComplianceCheck_ L1_5").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row8.ComplianceCheck_ L2_5").mandatory = "disabled";

  • How to change object background color on  java run time

    Hi,
    I create object loading program. my problem is run time i change object background color using color picker. i select any one color of color picker than submit. The selecting color not assign object background.
    pls help me? How to run time change object background color?
    here follwing code
    import com.sun.j3d.loaders.objectfile.ObjectFile;
    import com.sun.j3d.loaders.ParsingErrorException;
    import com.sun.j3d.loaders.IncorrectFormatException;
    import com.sun.j3d.loaders.Scene;
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    import com.sun.j3d.utils.applet.MainFrame;
    import com.sun.j3d.utils.universe.*;
    import javax.media.j3d.*;
    import javax.vecmath.*;
    import java.io.*;
    import com.sun.j3d.utils.behaviors.vp.*;
    import java.net.URL;
    import java.net.MalformedURLException;
    import java.awt.Graphics ;
    import javax.swing.*;
    public class ObjLoad1 extends Applet implements ActionListener
    private boolean spin = false;
    private boolean noTriangulate = false;
    private boolean noStripify = false;
    private double creaseAngle = 60.0;
    private URL filename = null;
    private SimpleUniverse u;
    private BoundingSphere bounds;
    private Panel cardPanel;
    private Button Tit,sub;
    private CardLayout ourLayout;
    private BorderLayout bl;
    Background bgNode;
    BranchGroup objRoot;
    List thelist;
    Label l1;
    public BranchGroup createSceneGraph()
    BranchGroup objRoot = new BranchGroup();
    TransformGroup objScale = new TransformGroup();
    Transform3D t3d = new Transform3D();
    t3d.setScale(0.7);
    objScale.setTransform(t3d);
    objRoot.addChild(objScale);
    TransformGroup objTrans = new TransformGroup();
    objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
    objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
    objScale.addChild(objTrans);
    int flags = ObjectFile.RESIZE;
    if (!noTriangulate) flags |= ObjectFile.TRIANGULATE;
    if (!noStripify) flags |= ObjectFile.STRIPIFY;
    ObjectFile f = new ObjectFile(flags,(float)(creaseAngle * Math.PI / 180.0));
    Scene s = null;
         try {
              s = f.load(filename);
         catch (FileNotFoundException e) {
         System.err.println(e);
         System.exit(1);
         catch (ParsingErrorException e) {
         System.err.println(e);
         System.exit(1);
         catch (IncorrectFormatException e) {
         System.err.println(e);
         System.exit(1);
         objTrans.addChild(s.getSceneGroup());
         bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);
    if (spin) {
         Transform3D yAxis = new Transform3D();
         Alpha rotationAlpha = new Alpha(-1, Alpha.INCREASING_ENABLE,0,0,4000,0,0,0,0,0);
         RotationInterpolator rotator = new RotationInterpolator(rotationAlpha,objTrans,yAxis,0.0f,(float) Math.PI*2.0f);
         rotator.setSchedulingBounds(bounds);
         objTrans.addChild(rotator);
    //Background color setting
    Color3f bgColor = new Color3f(100,200,230);
    bgNode = new Background(bgColor);
    bgNode.setApplicationBounds(bounds);
    objRoot.addChild(bgNode);
    return objRoot;
    private void usage()
    System.out.println("Usage: java ObjLoad1 [-s] [-n] [-t] [-c degrees] <.obj file>");
    System.out.println("-s Spin (no user interaction)");
    System.out.println("-n No triangulation");
    System.out.println("-t No stripification");
    System.out.println("-c Set crease angle for normal generation (default is 60 without");
    System.out.println("smoothing group info, otherwise 180 within smoothing groups)");
    System.exit(0);
    } // End of usage
    public void init() {
    if (filename == null) {
    try {
    URL path = getCodeBase();
    filename = new URL(path.toString() + "./galleon.obj");
    catch (MalformedURLException e) {
         System.err.println(e);
         System.exit(1);
         //setLayout(new BorderLayout());
         //setLayout(new GridLayout(5,0));
         //setLayout(new CardLayout());
         //setLayout(new FlowLayout(FlowLayout.LEFT, 5, 5));
    GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
    Canvas3D c = new Canvas3D(config);
    add(c);
    BranchGroup scene = createSceneGraph();
    u = new SimpleUniverse(c);
    ViewingPlatform viewingPlatform = u.getViewingPlatform();
    PlatformGeometry pg = new PlatformGeometry();
    Color3f ambientColor = new Color3f(45,27,15);
    AmbientLight ambientLightNode = new AmbientLight(ambientColor);
    ambientLightNode.setInfluencingBounds(bounds);
    pg.addChild(ambientLightNode);
    Color3f light1Color = new Color3f(111,222,222);
    Vector3f light1Direction = new Vector3f(1.0f, 1.0f, 1.0f);
    Color3f light2Color = new Color3f(1.0f, 1.0f, 1.0f);
    Vector3f light2Direction = new Vector3f(-1.0f, -1.0f, -1.0f);
    DirectionalLight light1 = new DirectionalLight(light1Color, light1Direction);
    light1.setInfluencingBounds(bounds);
    pg.addChild(light1);
    DirectionalLight light2 = new DirectionalLight(light2Color, light2Direction);
    light2.setInfluencingBounds(bounds);
    pg.addChild(light2);
    viewingPlatform.setPlatformGeometry(pg);
    viewingPlatform.setNominalViewingTransform();
    if (!spin) {
    OrbitBehavior orbit = new OrbitBehavior(c,OrbitBehavior.REVERSE_ALL);
    BoundingSphere bounds = new BoundingSphere(new Point3d(0.0, 0.0, 0.0), 100.0);
    orbit.setSchedulingBounds(bounds);
    viewingPlatform.setViewPlatformBehavior(orbit);     
    u.addBranchGraph(scene);
         public ObjLoad1(String[] args) {
              if (args.length != 0) {
                   for (int i = 0 ; i < args.length ; i++) {
                        if (args.startsWith("-")) {
                             if (args[i].equals("-s")) {
                                  spin = true;
                             } else if (args[i].equals("-n")) {
                                  noTriangulate = true;
                             } else if (args[i].equals("-t")) {
                                  noStripify = true;
                             } else if (args[i].equals("-c")) {
                                  if (i < args.length - 1) {
                                       creaseAngle = (new Double(args[++i])).doubleValue();
                                  } else usage();
                             } else {
                                  usage();
                        } else {
                             try {
                                  if ((args[i].indexOf("file:") == 0) ||
                                            (args[i].indexOf("http") == 0)) {
                                       filename = new URL(args[i]);
                                  else if (args[i].charAt(0) != '/') {
                                       filename = new URL("file:./" + args[i]);
                                  else {
                                       filename = new URL("file:" + args[i]);
                             catch (MalformedURLException e) {
                                  System.err.println(e);
                                  System.exit(1);
    public void actionPerformed(ActionEvent e)
         if (e.getSource() == Tit)
    //Color Picker tool
              Color c1 = JColorChooser.showDialog(((Component)e.getSource()).getParent(),"Zaxis Color Picker", Color.blue);
              cardPanel.setBackground(c1);
              objRoot.removeChild(bgNode);
              int a = c1.getRed();
              int b = c1.getBlue();
              int c = c1.getBlue();
              System.out.println(a);
              System.out.println(b);
              System.out.println(c);
              Color3f ccc = new Color3f(a,b,c);
              bgNode.setApplicationBounds(bounds);
         objRoot.addChild(bgNode);
         else
              System.out.println("mathi");
    public ObjLoad1()
    Tit = new Button("BG Color");
    sub = new Button("Object Color");
    cardPanel = new Panel();
    cardPanel.add(Tit);
    cardPanel.add(sub);
    //cardPanel.add(l1);
    //cardPanel.add(thelist);
    sub.addActionListener(this);
    Tit.addActionListener(this);
    // thelist.addActionListener(this);
    //setLayout for applet to be BorderLayout
    this.setLayout(new BorderLayout());
    //button Panel goes South, card panels go Center
    this.add(cardPanel, BorderLayout.SOUTH);
    //this.add(cardPanel, BorderLayout.CENTER);     
    this.setVisible(true);
    public void destroy() {
    public static void main(String[] args) {
         new MainFrame(new ObjLoad1(args),400, 400);

    hi,
    i am using setColor(Color3f color) method
    like
    if (e.getSource() == Tit)
              Color c1 = JColorChooser.showDialog(((Component)e.getSource()).getParent(),"Zaxis Color Picker", Color.blue);
              bgColor = new Color3f(c1);
              System.out.println(bgColor.get());
         bgNode.setColor(bgColor);
         bgNode.setApplicationBounds(bounds);
         objRoot.addChild(bgNode);
    but error will be displayed
    like
    javax.media.j3d.CapabilityNotSetException: Background: no capability to set color
         at javax.media.j3d.Background.setColor(Background.java:307)
         at ObjLoad1.actionPerformed(ObjLoad1.java:230)
         at java.awt.Button.processActionEvent(Unknown Source)
         at java.awt.Button.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    pls help me

  • How can I use undo and redo with run time menu?

    Hi..I try to built my own menu for graphic programming. How can I use undo and redo in labview with run time menu?

    filozof-
    During runtime, by default, LabVIEW has undo/redo data changes under the edit menu. This will undo/redo changes made to controls during runtime. If you want a more extensive undo/redo (custom for your application), you are going to have to do quite a few things
    1) Create a custom runtime menu (Edit>>RunTime Menu) and place your own undo/redo controls on it
    2) Keep an action history in your program
    3) Catch the Shortcut menu event for your custom undo/redo controls
    4) Reverse the last action in your histroy when you catch the event
    This method would allow you undo entire operations (like resize, move, or whatever kind of functionality you are building into your application) unstead of just undoing data changes.
    Xaq

Maybe you are looking for