Added new classes

Hi everybody,
I am a Java beginner and i would like to know the good way to put new classes i want to use.
I would like to use a class named "netscape.javascript.JSObject", this one is located in a .zip file and i put it in my Java home dir (c:\j2sdk1.4_03 (That is also in my CLASSPATH)) but it does not work at compilation time (does not find package "netscape.javascript.JSObject")!!!
If i dezip all classes from .zip file, then it creates all directory structure from this .zip file and especially netscape/javascript/*.* branch in my c:\j2sdk1.4_03 directory and this way it compiles.
In fact netscape/javascript/ dir contains two classes JSObject and JSException (those classes need certain other classes include in the same .zip file so i dezip all classes !!)
I though that a .zip file was only needed to use class (if CLASSPATH is correctly set)
1) Is there a good way (path) to add classes we wanted to use ?
2) It compiles but crash in run time ....
here is a little code sample to test:
import netscape.javascript.JSObject;
public static class Test{
public static void main(String[] args){
try{
Class c = Class.forName("netscape.javascript.JSObject");
catch(ClassNotFoundException e){
System.err.println(e);
and i receive the message when i want to run it ...
"Exception in thread "main" java.lang.UnsatisfiedLinkError: IIDFromString
at com.ms.com._Guid.IIDFromString(Native Method)
at com.ms.com._Guid.set(_Guid.java)
at com.ms.com._Guid.<init>(_Guid.java)
at netscape.javascript.JSObject.<clinit>(JSObject.java)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:140)
at lpa.examples.GrepReader$Test.main(GrepReader.java:38)"
Is this a version problem ?
I hope you understand my problem.
Can somebody help me ?
Thanks for your help
PS ; Sorry for my probably bad english but it is not my native language ...

For JAR and ZIP files, you need to add the file to the classpath, not just the parent directory.

Similar Messages

  • Adding new class in already created DIR

    I created a DIR and it is in released staus .
    I change the status from released to correction. One class is already added in the DIR. I want to add a new class in that DIR. but the system won't allow me. Message appearing "Multiple classification not allowed"
    Can anyone help?
    Its urgent

    Message appearing "Multiple classification not allowed"
    Propose you setup a Class Hierarchy to meet your requirement.Herein,you would need to create a parent class and assign subordinate classes to it.
    For Eg: Assume you have created classes Class ABC and Class PQR and you need to assign both of these to a Document Type.When you attempt to do this, the system throws up a message  "Multiple classification not allowed". Hence,you need to create another new class Class XYZ and assign both the previously created classes Class ABC and Class PQR to it. (Path:SAP Menu> CA components> Classification S/m > Assignment > Assign objects/Classes to classes)
    Once done,you would have to assign Class XYZ to the required Document Type.This will ensure that the required classes are assigned and reflect in the Document Type.
    Regards,
    Pradeepkumar Haragoldavar

  • Adding a new class with Creator (really simple problem i think..)

    I added a new class to my project with creator...
    class name is "CambiaNote" and there's a method called Cambia
    tabellaselezionabile is my project(package)
    I tried to run everything but It gave me an error:
    Exception Details:  org.apache.jasper.JasperException
      Error getting property 'cambia' from bean of type tabellaselezionabile.Page1I don't know, but the word cambia don't exists at all in my code... or it is not case sensitive..?
    please help, thanks

    typo: correct Paint() to paint()

  • Adding componets to a new class

    I've created a new class for BidFrame Jframe, and would like to get contents from the previous method to use, or even start afresh. But when i declare an item, it still doesn't work. What am i doing wrong? The problem lies in BidFrame extend JFrame....if the code is taken out of the two brackets, everything else works. Please help
    import java.awt.*;
    import java.awt.event.*;
    import java.text.DecimalFormat;
    import javax.swing.*;
    import javax.swing.border.*;
    import java.lang.*;
    public class EasyAuction extends JFrame
         // JPanel for login window
                 private JPanel  biddingJPanel, oneJPanel, welcomeJPanel, registertwoaJPanel;
                 private JLabel titleJLabel, buyernameJLabel, buyerpasswordJLabel, buyerJLabel, sellernameJLabel, sellerpasswordJLabel, sellerJLabel;
                 private JButton buyerJButton, sellerJButton, registeroneJButton, registertwoJButton;
                 private JTextField buyernameJTextField, buyerpasswordJTextField, sellernameJTextField, sellerpasswordJTextField;
                 private JComboBox itemJComboBox;
                 public JPanel BidFrameJFrame;
    //Publics JPanels
    //public JPanel registertwoJFrame;
                //contentPane
                 public Container contentPane, c;
                 //no argument constructor
                 public EasyAuction()
                      createUserInterface();
                 //create and position components
                 private void createUserInterface()
                     //get contentPane
                      contentPane = getContentPane();
                      c = getContentPane();
                   //and set layout to null
                      contentPane.setLayout(null);
                      c.setLayout(null);
                   //goes to public void welcome
                      login();
                      //set properties of applications window
                      setTitle( "Easy Auction" ); // set JFrame's title bar string
                    setSize( 300, 200);   // set width and height of JFrame
                    setVisible( true );    // display JFrame on screen
                 } // end method createUserInterface
                 public void login(){
                           //setup oneJPanel
                           oneJPanel = new JPanel();
                           oneJPanel.setLayout( new FlowLayout() );
                           oneJPanel.setBounds(0,0, 300,200);
                           oneJPanel.setVisible(true);
                         // setup buyernameJLabel
                         buyernameJLabel = new JLabel();
                         buyernameJLabel.setText("Buyer Name");
                         oneJPanel.add( buyernameJLabel );
                         //setup nameJTextField
                         buyernameJTextField = new JTextField(15);
                        buyernameJTextField.
                        setEnabled(true);
                        oneJPanel.add( buyernameJTextField );
                        //setup buyerpasswordJLabel
                        buyerpasswordJLabel = new JLabel();
                        buyerpasswordJLabel.setText("Pass word  ");
                        oneJPanel.add( buyerpasswordJLabel);
                        //setup buyerpasswordJTextField
                        buyerpasswordJTextField = new JTextField(15);
                        buyerpasswordJTextField.setEnabled(true);
                        oneJPanel.add( buyerpasswordJTextField);
                        //setup buyerJLabel
                        buyerJLabel = new JLabel();
                        buyerJLabel.setText("Click on Buyer Button");
                        oneJPanel.add(buyerJLabel);
                        //setup buyerJButton
                        buyerJButton = new JButton ();
                        buyerJButton.setText("Buyer");
                        buyerJButton.setBackground( Color.YELLOW );
                        oneJPanel.add( buyerJButton );
                        buyerJButton.addActionListener(
                             new ActionListener(){
                                  public void actionPerformed( ActionEvent event )
                                       BidFrame f = new BidFrame();
                                   f.setVisible(true);
                        //setup registeroneJButton
                        registeroneJButton = new JButton ();
                        registeroneJButton.setText ("Register");
                        registeroneJButton.setBackground ( Color.ORANGE);
                        oneJPanel.add( registeroneJButton);
                        //setup sellernameJLabel
                        sellernameJLabel = new JLabel();
                        sellernameJLabel.setText("Seller Name");
                        oneJPanel.add( sellernameJLabel);
                        //setup sellernameJTextField
                        sellernameJTextField = new JTextField(15);
                        sellernameJTextField.setEnabled(true);
                        oneJPanel.add(sellernameJTextField);
                        //setup sellerpasswordJLabel
                        sellerpasswordJLabel = new JLabel();
                        sellerpasswordJLabel.setText("Pass word  ");
                        oneJPanel.add( sellerpasswordJLabel );
                        //setup sellerpasswordJTextField
                        sellerpasswordJTextField = new JTextField(15);
                        sellerpasswordJTextField.setEnabled(true);
                        oneJPanel.add( sellerpasswordJTextField );
                        //setup sellerJLabel
                        sellerJLabel = new JLabel();
                        sellerJLabel.setText("Click on Seller Button");
                        oneJPanel.add(sellerJLabel);
                        //setup sellerJButton
                        sellerJButton = new JButton ();
                        sellerJButton.setText("Seller");
                        sellerJButton.setBackground( Color.YELLOW );
                        oneJPanel.add( sellerJButton );
                        //setup registertwoJButton ();
                        registertwoJButton = new JButton ();
                        registertwoJButton.setText("Register");
                        registertwoJButton.setBackground( Color.ORANGE);
                        oneJPanel.add( registertwoJButton );
                        contentPane.add(oneJPanel);
                    return;          
              public class BidFrame extends JFrame
                      oneJPanel.setVisible(false);
                   biddingJPanel = new JPanel ();
         biddingJPanel.setLayout( new FlowLayout() );
              biddingJPanel.setBounds(0, 0, 300,200);
              biddingJPanel.setVisible(true);
              setup itemJComboBox
              itemJComboBox = new JComboBox( );
              biddingJPanel.add (itemJComboBox);
              contentPane.add(biddingJPanel);
              // main method
                 public static void main( String[] args )
                    EasyAuction application = new EasyAuction();
                    application.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
                 } // end method main
    }//ends public class Bidding 

    Normally you would use a modal JDialog, not a JFrame, to gather additional information.
    If you need data to display in the dialog then just pass the data when you create the dialog:
    BidDialog dialog = new BidDialog(parameter1, parameter2, ....);
    dialog.setModal( true );
    dialog.setVisible(true);

  • TableSorter errors when adding new data

    so here is the deal:
    I am using the TableSorter.java helper class with DefaultTableModel
    from: http://java.sun.com/docs/books/tutorial/uiswing/components/table.html
    It works great when the data is static and I get it for the first time. however, occationally, when adding new data I get a NullPointerException error.
    in use:
    DefaultTableModel.addRow()
    DefaultTableModel.removeRow() and
    DefaultTableModel.insertRow() methods.
    Error:
    java.lang.ArrayIndexOutOfBoundsException: 5
         at com.shared.model.TableSorter.modelIndex(TableSorter.java:294)
         at com.shared.model.TableSorter.getValueAt(TableSorter.java:340)
         at javax.swing.JTable.getValueAt(Unknown Source)
         at javax.swing.JTable.prepareRenderer(Unknown Source)...
    code problem I:
        public Object getValueAt(int row, int column)
            return tableModel.getValueAt(modelIndex(row), column);
        }code problem II:
        public int modelIndex(int viewIndex)
                 return getViewToModel()[viewIndex].modelIndex;     
        }TableSroter class:
    package com.shared.model;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.util.List;
    import javax.swing.*;
    import javax.swing.event.TableModelEvent;
    import javax.swing.event.TableModelListener;
    import javax.swing.table.*;
    * TableSorter is a decorator for TableModels; adding sorting
    * functionality to a supplied TableModel. TableSorter does
    * not store or copy the data in its TableModel; instead it maintains
    * a map from the row indexes of the view to the row indexes of the
    * model. As requests are made of the sorter (like getValueAt(row, col))
    * they are passed to the underlying model after the row numbers
    * have been translated via the internal mapping array. This way,
    * the TableSorter appears to hold another copy of the table
    * with the rows in a different order.
    * <p/>
    * TableSorter registers itself as a listener to the underlying model,
    * just as the JTable itself would. Events recieved from the model
    * are examined, sometimes manipulated (typically widened), and then
    * passed on to the TableSorter's listeners (typically the JTable).
    * If a change to the model has invalidated the order of TableSorter's
    * rows, a note of this is made and the sorter will resort the
    * rows the next time a value is requested.
    * <p/>
    * When the tableHeader property is set, either by using the
    * setTableHeader() method or the two argument constructor, the
    * table header may be used as a complete UI for TableSorter.
    * The default renderer of the tableHeader is decorated with a renderer
    * that indicates the sorting status of each column. In addition,
    * a mouse listener is installed with the following behavior:
    * <ul>
    * <li>
    * Mouse-click: Clears the sorting status of all other columns
    * and advances the sorting status of that column through three
    * values: {NOT_SORTED, ASCENDING, DESCENDING} (then back to
    * NOT_SORTED again).
    * <li>
    * SHIFT-mouse-click: Clears the sorting status of all other columns
    * and cycles the sorting status of the column through the same
    * three values, in the opposite order: {NOT_SORTED, DESCENDING, ASCENDING}.
    * <li>
    * CONTROL-mouse-click and CONTROL-SHIFT-mouse-click: as above except
    * that the changes to the column do not cancel the statuses of columns
    * that are already sorting - giving a way to initiate a compound
    * sort.
    * </ul>
    * <p/>
    * This is a long overdue rewrite of a class of the same name that
    * first appeared in the swing table demos in 1997.
    * @author Philip Milne
    * @author Brendon McLean
    * @author Dan van Enckevort
    * @author Parwinder Sekhon
    * @version 2.0 02/27/04
    public class TableSorter extends AbstractTableModel
        protected TableModel tableModel;
        public static final int DESCENDING = -1;
        public static final int NOT_SORTED = 0;
        public static final int ASCENDING = 1;
        private static Directive EMPTY_DIRECTIVE = new Directive(-1, NOT_SORTED);
        public static final Comparator COMPARABLE_COMAPRATOR = new Comparator()
            public int compare(Object o1, Object o2)
                return ((Comparable) o1).compareTo(o2);
        public static final Comparator LEXICAL_COMPARATOR = new Comparator()
            public int compare(Object o1, Object o2)
                return o1.toString().compareTo(o2.toString());
        private Row[] viewToModel;
        private int[] modelToView;
        private JTableHeader tableHeader;
        private MouseListener mouseListener;
        private TableModelListener tableModelListener;
        private Map columnComparators = new HashMap();
        private List sortingColumns = new ArrayList();
        public TableSorter()
            this.mouseListener = new MouseHandler();
            this.tableModelListener = new TableModelHandler();
        public TableSorter(TableModel tableModel)
            this();
            setTableModel(tableModel);
        public TableSorter(TableModel tableModel, JTableHeader tableHeader)
            this();
            setTableHeader(tableHeader);
            setTableModel(tableModel);
        private void clearSortingState()
            viewToModel = null;
            modelToView = null;
        public TableModel getTableModel()
            return tableModel;
        public void setTableModel(TableModel tableModel)
            if (this.tableModel != null)
                this.tableModel.removeTableModelListener(tableModelListener);
            this.tableModel = tableModel;
            if (this.tableModel != null)
                this.tableModel.addTableModelListener(tableModelListener);
            clearSortingState();
            fireTableStructureChanged();
        public JTableHeader getTableHeader()
            return tableHeader;
        public void setTableHeader(JTableHeader tableHeader)
            if (this.tableHeader != null)
                this.tableHeader.removeMouseListener(mouseListener);
                TableCellRenderer defaultRenderer = this.tableHeader.getDefaultRenderer();
                if (defaultRenderer instanceof SortableHeaderRenderer)
                    this.tableHeader.setDefaultRenderer(((SortableHeaderRenderer) defaultRenderer).tableCellRenderer);
            this.tableHeader = tableHeader;
            if (this.tableHeader != null)
                this.tableHeader.addMouseListener(mouseListener);
                this.tableHeader.setDefaultRenderer
                        new SortableHeaderRenderer(this.tableHeader.getDefaultRenderer())
        public boolean isSorting()
            return sortingColumns.size() != 0;
        private Directive getDirective(int column)
            for (int i = 0; i < sortingColumns.size(); i++)
                Directive directive = (Directive)sortingColumns.get(i);
                if (directive.column == column)
                    return directive;
            return EMPTY_DIRECTIVE;
        public int getSortingStatus(int column)
            return getDirective(column).direction;
        private void sortingStatusChanged()
            clearSortingState();
            fireTableDataChanged();
            if (tableHeader != null)
                tableHeader.repaint();
        public void setSortingStatus(int column, int status)
            Directive directive = getDirective(column);
            if (directive != EMPTY_DIRECTIVE)
                sortingColumns.remove(directive);
            if (status != NOT_SORTED)
                sortingColumns.add(new Directive(column, status));
            sortingStatusChanged();
        protected Icon getHeaderRendererIcon(int column, int size)
            Directive directive = getDirective(column);
            if (directive == EMPTY_DIRECTIVE)
                return null;
            return new Arrow(directive.direction == DESCENDING, size, sortingColumns.indexOf(directive));
        private void cancelSorting()
            sortingColumns.clear();
            sortingStatusChanged();
        public void setColumnComparator(Class type, Comparator comparator)
            if (comparator == null)
                columnComparators.remove(type);
            else
                columnComparators.put(type, comparator);
        protected Comparator getComparator(int column)
            Class columnType = tableModel.getColumnClass(column);
            Comparator comparator = (Comparator) columnComparators.get(columnType);
            if (comparator != null)
                return comparator;
            if (Comparable.class.isAssignableFrom(columnType))
                return COMPARABLE_COMAPRATOR;
            return LEXICAL_COMPARATOR;
        private Row[] getViewToModel()
            if (viewToModel == null)
                int tableModelRowCount = tableModel.getRowCount();
                viewToModel = new Row[tableModelRowCount];
                for (int row = 0; row < tableModelRowCount; row++)
                    viewToModel[row] = new Row(row);
                if (isSorting())
                    Arrays.sort(viewToModel);
            return viewToModel;
        public int modelIndex(int viewIndex)
                 return getViewToModel()[viewIndex].modelIndex;     
        private int[] getModelToView()
            if (modelToView == null)
                int n = getViewToModel().length;
                modelToView = new int[n];
                for (int i = 0; i < n; i++)
                    modelToView[modelIndex(i)] = i;
            return modelToView;
        // TableModel interface methods
        public int getRowCount()
            return (tableModel == null) ? 0 : tableModel.getRowCount();
        public int getColumnCount()
            return (tableModel == null) ? 0 : tableModel.getColumnCount();
        public String getColumnName(int column)
            return tableModel.getColumnName(column);
        public Class getColumnClass(int column)
            return tableModel.getColumnClass(column);
        public boolean isCellEditable(int row, int column)
            return tableModel.isCellEditable(modelIndex(row), column);
        public Object getValueAt(int row, int column)
            return tableModel.getValueAt(modelIndex(row), column);
        public void setValueAt(Object aValue, int row, int column)
            tableModel.setValueAt(aValue, modelIndex(row), column);
        // Helper classes
        private class Row implements Comparable
            private int modelIndex;
            public Row(int index)
                this.modelIndex = index;
            public int compareTo(Object o)
                int row1 = modelIndex;
                int row2 = ((Row) o).modelIndex;
                for (Iterator it = sortingColumns.iterator(); it.hasNext();)
                    Directive directive = (Directive) it.next();
                    int column = directive.column;
                    Object o1 = tableModel.getValueAt(row1, column);
                    Object o2 = tableModel.getValueAt(row2, column);
                    int comparison = 0;
                    // Define null less than everything, except null.
                    if (o1 == null && o2 == null)
                        comparison = 0;
                    } else if (o1 == null)
                        comparison = -1;
                    } else if (o2 == null)
                        comparison = 1;
                    } else {
                        comparison = getComparator(column).compare(o1, o2);
                    if (comparison != 0)
                        return directive.direction == DESCENDING ? -comparison : comparison;
                return 0;
        private class TableModelHandler implements TableModelListener
            public void tableChanged(TableModelEvent e)
                // If we're not sorting by anything, just pass the event along.            
                if (!isSorting())
                    clearSortingState();
                    fireTableChanged(e);
                    return;
                // If the table structure has changed, cancel the sorting; the            
                // sorting columns may have been either moved or deleted from            
                // the model.
                if (e.getFirstRow() == TableModelEvent.HEADER_ROW)
                    cancelSorting();
                    fireTableChanged(e);
                    return;
                // We can map a cell event through to the view without widening            
                // when the following conditions apply:
                // a) all the changes are on one row (e.getFirstRow() == e.getLastRow()) and,
                // b) all the changes are in one column (column != TableModelEvent.ALL_COLUMNS) and,
                // c) we are not sorting on that column (getSortingStatus(column) == NOT_SORTED) and,
                // d) a reverse lookup will not trigger a sort (modelToView != null)
                // Note: INSERT and DELETE events fail this test as they have column == ALL_COLUMNS.
                // The last check, for (modelToView != null) is to see if modelToView
                // is already allocated. If we don't do this check; sorting can become
                // a performance bottleneck for applications where cells 
                // change rapidly in different parts of the table. If cells
                // change alternately in the sorting column and then outside of            
                // it this class can end up re-sorting on alternate cell updates -
                // which can be a performance problem for large tables. The last
                // clause avoids this problem.
                int column = e.getColumn();
                if (e.getFirstRow() == e.getLastRow()
                        && column != TableModelEvent.ALL_COLUMNS
                        && getSortingStatus(column) == NOT_SORTED
                        && modelToView != null)
                    int viewIndex = getModelToView()[e.getFirstRow()];
                    fireTableChanged(new TableModelEvent(TableSorter.this,
                                                         viewIndex, viewIndex,
                                                         column, e.getType()));
                    return;
                // Something has happened to the data that may have invalidated the row order.
                clearSortingState();
                fireTableDataChanged();
                return;
        private class MouseHandler extends MouseAdapter
            public void mouseClicked(MouseEvent e)
                JTableHeader h = (JTableHeader) e.getSource();
                TableColumnModel columnModel = h.getColumnModel();
                int viewColumn = columnModel.getColumnIndexAtX(e.getX());
                int column = columnModel.getColumn(viewColumn).getModelIndex();
                if (column != -1)
                    int status = getSortingStatus(column);
                    if (!e.isControlDown())
                        cancelSorting();
                    // Cycle the sorting states through {NOT_SORTED, ASCENDING, DESCENDING} or
                    // {NOT_SORTED, DESCENDING, ASCENDING} depending on whether shift is pressed.
                    status = status + (e.isShiftDown() ? -1 : 1);
                    status = (status + 4) % 3 - 1; // signed mod, returning {-1, 0, 1}
                    setSortingStatus(column, status);
        private static class Arrow implements Icon
            private boolean descending;
            private int size;
            private int priority;
            public Arrow(boolean descending, int size, int priority)
                this.descending = descending;
                this.size = size;
                this.priority = priority;
            public void paintIcon(Component c, Graphics g, int x, int y)
                Color color = c == null ? Color.GRAY : c.getBackground();            
                // In a compound sort, make each succesive triangle 20%
                // smaller than the previous one.
                int dx = (int)(size/2*Math.pow(0.8, priority));
                int dy = descending ? dx : -dx;
                // Align icon (roughly) with font baseline.
                y = y + 5*size/6 + (descending ? -dy : 0);
                int shift = descending ? 1 : -1;
                g.translate(x, y);
                // Right diagonal.
                g.setColor(color.darker());
                g.drawLine(dx / 2, dy, 0, 0);
                g.drawLine(dx / 2, dy + shift, 0, shift);
                // Left diagonal.
                g.setColor(color.brighter());
                g.drawLine(dx / 2, dy, dx, 0);
                g.drawLine(dx / 2, dy + shift, dx, shift);
                // Horizontal line.
                if (descending) {
                    g.setColor(color.darker().darker());
                } else {
                    g.setColor(color.brighter().brighter());
                g.drawLine(dx, 0, 0, 0);
                g.setColor(color);
                g.translate(-x, -y);
            public int getIconWidth()
                return size;
            public int getIconHeight()
                return size;
        private class SortableHeaderRenderer implements TableCellRenderer
            private TableCellRenderer tableCellRenderer;
            public SortableHeaderRenderer(TableCellRenderer tableCellRenderer)
                this.tableCellRenderer = tableCellRenderer;
            public Component getTableCellRendererComponent(JTable table,
                                                           Object value,
                                                           boolean isSelected,
                                                           boolean hasFocus,
                                                           int row,
                                                           int column)
                Component c = tableCellRenderer.getTableCellRendererComponent(table,
                        value, isSelected, hasFocus, row, column);
                if (c instanceof JLabel) {
                    JLabel l = (JLabel) c;
                    l.setHorizontalTextPosition(JLabel.LEFT);
                    int modelColumn = table.convertColumnIndexToModel(column);
                    l.setIcon(getHeaderRendererIcon(modelColumn, l.getFont().getSize()));
                return c;
        private static class Directive
            private int column;
            private int direction;
            public Directive(int column, int direction)
                this.column = column;
                this.direction = direction;
    }any input will be appreciated.
    thanks
    Peter

    The code you posted doesn't help us at all. Its just a duplicate of the code from the tutorial. The custom code is what you have written. For example do you update the TableModel from the Event Thread? Do you update the SortModel or the DefaultTableModel? If you actually provide your test code and somebody has already downloaded the sort classes, then maybe they will test your code against the classes. But I doubt if people will download the sort classes and create a test program just to see if they can duplicate your results (at least I know I'm not about to).

  • How to add new class to existing DC (Web Dynpro project)

    Hi,
    How can I add new class to an existing DC (Web Dynpro project)?
    I tried adding it using File - New - Other - Java - Class, but after a build of the DC the new class (and its contents    ) was completely removed.
    Then I created a new DC (java project) and created a new class in that DC. This went fine, but I got into problems because of circular referencing between the new & the old DC, so no build was possible.
    This can't be difficult, does somebody knows how to do it?
    My temporary solution is to add the classdefinition to an exisiting .java file. Very ugly.
    Thanks,
    Jeroen

    Hi Jeroen,
    where did you create the class? If the *.java file is placed in the src/packages folder it should not be deleted by a build. (I suspect you created it in the gen_wdp folder?)
    Regards,
    Marc

  • Creating a new class type in the classification system

    We are wanting to classify objects in a ZTABLE.  We have a home grown system for defining our customer requirements that is used as the way for the sales people to communicate to the engineering dept. what the customer wants.  A new need has come up that seems to be a good fit to be able to classify our customer requirements.  I have been trying to create a new class type that is linked to our ZTABLE.  However, even though it looks like we should be able to do this I have not been able to do it.  I ran across some documentation that seems to imply that adding a new class type used to be possible, but no longer is.
    Can anyone verify that creating a new class type is still possible to do?  We are on ECC 5.0.

    Can someone point me in the right direction as to how to create my own Class Type.  Is there some documentation as to how to dow this? Other than what is fould in SPRO I have tried and tried but no joy for me. 
    This is what I have done so far:
    in SPRO:
    1) Created an Object Key for my table ZLO_CUSTREQ.  This table has a primary key of CRQNR (custormer requirements number which is I created)  The documentation says that I need to add this key field to structure RMCLY (I did that).  BUT, it also says the RMCLY is embeded in structure RMCLX and it is not.  Do I need to modify RMCLX to add RMCLY as an append structure?
    2) Went to Maintain Object types and Class types and selected my table. Double clicked on Class Types in the Dialog Structure tree, which displayed an empty list of class types. 
    I then Clicked New Entries button and filled in the fields: Class type(Z10), Description(Customer Requirements), Table(ZLO_CUSTREQ).  in the Screens group I selected Keywords and Characteristics.  In the Functions group I selected: Standard class type and Multiple classifications. I then Clicked the back arrow.  This returned me to the Class Types list which now displayed my new class type. 
    When I click the save button it kicks me out the the SPRO menu screen and I get the warning message "Class type Z10 does not have the classification status incomplete system" . 
    Then, it won't let me re-enter the Maintain Object types and Class Types screen due to an error "View cluster is already open, go back with F3"
    When I hit F3 I am returned to the main SPRO screen.  After navigating back to the Maintain Object types and Class types I continue to get the View cluster already open error.  The only way I can get back to Maintain Object types and Class types  is to completely exit SPRO and start over.  When I do, class type Z10 is gone.
    I have repeated this procedure several times with always the same results.
    Can anyone please help me?

  • How to add new class in modified template...

    Finally I have encourage myself to scratch to (for me deepest darkwood) templates...
    I have modified original Theme 2 to My theme 2 and added in some tempaltes region my parts-looks promising.
    Now I want to create sidebar region that is 450 px wide.
    It should be the same sidebar region but with different width!
    I saw on file system that there is .css so I add this class in it....(as aspected) it is not shown in template class list...
    I am able to apply that new class to template, but I cannot see that class in "Template Class" LOV (in Edit Region Template form).
    Is that important and could this bee seen in that list?
    THX!

    I have now working template with my new class...
    What is still bothering me is that I have editeted "theme_V2.css" file. I'm plannig to put my app on hosted WEB site in Germany, where this file will not be the same as is on my server.
    How to achieve future compatibilty according this?
    THX!

  • Old globals with new classes

    Please forgive my ignorance:
    I'm porting some old illustrator sdk code into the illustrator cs5 sdk.  I plan on making this a hybrid plugin where the UI is built in flash builder.  I am using the FreeGrid sample as a model.
    My old code is based in the old "shell" model, where in there is a file called common.h which contains a the line "extern Globals *g;".
    I was able to keep use these globals to store some preferences for the life of the plug-in.
    Is there a way to achieve this using the new class model.  I tried to declare a public member variable in the FreeGridPlugin class called "selected".  Then I added a pointer to FreeGridPlugin instance as a member of the FreeGridDialogControler class.  But when I try to access the FreeGridPlugin methods from the FreeGridDialogControler methods I get the error "bool FreeGridPlugin::selected is private within this context".  I can't figure out what I'm doing wrong of if there's a better way to go about this, but really need to be able set edit some variables whether from the dialog controler and from elsewhere.  How can I have these variables persist, and not go away as instances of classes are created and deleted?
    Or am I just completely backwards on all this?
    Any help would be MUCH appreciated.  Thanks.

    I know almost nothing about any of the Flash stuff, so take this with a grain of salt -- but if you're having trouble with things going away when the plugin reloads & unloads, have you tried making it persistent? I.e., make sure it never unloads? We avoid all that crap about the VTABLE fix and such by just making sure MAPublisher is in memory, all the time. You do that by doing this:
    SPAccessRef m_pluginAccess = 0;
    AIErr error = sSPAccess->AcquirePlugin(GetPluginRef(), &m_pluginAccess);
    (you can get the plugin ref in any message, so StartUp will have one)
    Just call
    AIErr error = sSPAccess->ReleasePlugin(m_pluginAccess);
    in the ShutdownPlugin message

  • [svn:osmf:] 11184: Adding new temporal metadata support, including sample app and unit tests.

    Revision: 11184
    Author:   [email protected]
    Date:     2009-10-27 11:08:21 -0700 (Tue, 27 Oct 2009)
    Log Message:
    Adding new temporal metadata support, including sample app and unit tests.
    Added Paths:
        osmf/trunk/apps/samples/framework/CuePointSample/
        osmf/trunk/apps/samples/framework/CuePointSample/.actionScriptProperties
        osmf/trunk/apps/samples/framework/CuePointSample/.flexProperties
        osmf/trunk/apps/samples/framework/CuePointSample/.project
        osmf/trunk/apps/samples/framework/CuePointSample/html-template/
        osmf/trunk/apps/samples/framework/CuePointSample/html-template/AC_OETags.js
        osmf/trunk/apps/samples/framework/CuePointSample/html-template/history/
        osmf/trunk/apps/samples/framework/CuePointSample/html-template/history/history.css
        osmf/trunk/apps/samples/framework/CuePointSample/html-template/history/history.js
        osmf/trunk/apps/samples/framework/CuePointSample/html-template/history/historyFrame.html
        osmf/trunk/apps/samples/framework/CuePointSample/html-template/index.template.html
        osmf/trunk/apps/samples/framework/CuePointSample/html-template/playerProductInstall.swf
        osmf/trunk/apps/samples/framework/CuePointSample/libs/
        osmf/trunk/apps/samples/framework/CuePointSample/src/
        osmf/trunk/apps/samples/framework/CuePointSample/src/CuePointSample.css
        osmf/trunk/apps/samples/framework/CuePointSample/src/CuePointSample.mxml
        osmf/trunk/framework/MediaFramework/org/osmf/metadata/TemporalFacet.as
        osmf/trunk/framework/MediaFramework/org/osmf/metadata/TemporalFacetEvent.as
        osmf/trunk/framework/MediaFramework/org/osmf/metadata/TemporalIdentifier.as
        osmf/trunk/framework/MediaFramework/org/osmf/video/CuePoint.as
        osmf/trunk/framework/MediaFramework/org/osmf/video/CuePointType.as
        osmf/trunk/framework/MediaFrameworkFlexTest/org/osmf/metadata/TestTemporalFacet.as
        osmf/trunk/framework/MediaFrameworkFlexTest/org/osmf/video/TestCuePoint.as

    Greg -
        The metadata sample demonstrates how metadata can be placed on an IMediaResource, and used to  give the framework more information about the resource.  The MediaFactory uses this information to determine which type of media a given resource points to.  One of the intial problems we encountered when creating a media factory that created MediaElements from URLResources, was the inability to distinguish between image, video, and audio urls, since the extension isn't a guaranteed way.
    The Metadata framework, that was developed last sprint was provided to enable metadata such as XMP, Namevalue, and Cuepoints.  Not all specific classes that hold this data haven't been created yet however.  The logic to add metadata automatically hasn't been placed in the framework yet.
    It's currenty possible to retrieve onPlaystatus, onMetadata, onXMPData, onImagedata, and onCuepoint callbacks:
    var videoElement:VideoElement
    [After videoElement loads]
    videoElement.client.addHandler(NetStreamCodes.ON_XMP_DATA, onXMPData);
    function onXMPData(info:Object):void
       //Process XMP here.
    Hope this helps.

  • Is it possible to extend bytearrayoutputstream to a new class

    hi is it possible to extend byteArrayoutputStream class to my new class so that i can directly access the buf[] (instace of bytearrayoutputstream), if so how to do it and what are the functions i need to override and provide me any tutorials or topics on this....

    manju_hawk wrote:
    hi is it possible to have my new class extend byteArrayoutputStreamYes (fixed slightly).
    manju_hawk wrote:
    so that i can directly access the buf[] (instace of bytearrayoutputstream),Though why would you want to do that? You can already access the buffer as ByteArrayOutputStream.toByteArray() outside of that class. Regardless, see [the Inheritance trail|http://java.sun.com/docs/books/tutorial/java/IandI/subclasses.html] of the Java tutorial for more information on overriding methods. I don't think you'd need to override many methods in your ByteArrayOutputStream subclass though, just read(byte[], int, int) and write(byte[], int, int) probably.
    Edited by: Looce on Nov 12, 2008 1:18 AM (added more information)

  • Adding new feature without recompiling

    i have a question
    i have this program in java that translates one language to another now i want to be able to add another translator later if i required at runtime without recompiling the whole thing.that is i should have the provision of adding new translators feature which i dont know now about, later without compiling.
    if anybody could guide me i will really appreciate that
    thanks

    A factory might do the job if you've organized your existing code properly.
    Assume an interface exists:public interface Translator {
       public String translate(String text);
    }Also suppose you already have a single translator:package my.package;
    public class EnglishToDutchTranslator implements Translator {
       public String translate(String text) {
          return translation;
    }Store this fact in a .properties file or preferences or whereever:ENDU= my.package.EnglishToDutchTranslatorHere's the factory:public final class TranslatorFactory {
       // contains the above name -> tranlator class name mappings
       private static Properties translators;
       // don't instantiate this class
       private TranslatorFactory() { }
       public static Translator getTranslator(String name) {
          String clazz= translators.getProperty(name);
          if (clazz == null) return null;
          try {
             return (Translator)Class.forName(clazz).newInstance();
          catch (Exception e) {
             e.printStackTrace();
             return null;
    }Basically all the factory does is 1) get the fully qualified class name
    given the name of the translator and 2) instantiate an object from that
    class. All that it cares about is that the object implements the Translator
    interface. You can build new translators and register them in that
    properties file. A caller should get a translator as follows:Translater t= TranslatorFactory.getTranslator("ENDU");kind regards,
    Jos

  • Adding New Dialogs

    I am trying to figure out how to display a second dialog after a button click in my main dialog. I have done the following to add a new dialog, but when I click my main button, nothing happens and InDesign crashes. Can anyone tell me what I am doing wrong. Is there a good description or code snippet that shows how to implement multiple dialog boxes?
    ..in the __ID.h file, I add a new dialog boss class, new controller and observer Impl, new dialog widget ID, and define a new rsrc id for the second dialog.
    .. I create the new observer and controller files and add them to the project creating a new interface using the new Impl's.
    ..in the __.fr file, In the class description table I add a new class for the second dialog based on kDialogBoss and implementing the new controller and observer Impl. Create a new resource type based on Dialog using the new dialog boss. Then create a new resource of the new type with the new widget Id.
    ..In the observer code of the main dialog, I use CreateNewDialog based on a rsrcSpec using the resource id of the new dialog.
    (Could this be any more complicated?)

    Hi Liz,
    The steps you have used for creating New dialog are correct.
    Try adding following code in your __.fr file where kSecondDialogResourceID is the resource id of the new dialog.
    resource LocaleIndex (kSecondDialogResourceID)
    kViewRsrcType,
    kWildFS,k_Wild, kSecondDialogResourceID + index_enUS
    You also make the dialog Type as Modeless in CreateNewDialog()
    IDialog* dialog = dialogMgr->CreateNewDialog(dialogSpec,
    IDialog::kModeless);
    Pls reply if your problem is solved.

  • Is there any way to force jvm load a new class?

    I write a standalone command line program. This program calls a function which I added to an existing class. the existing class has run run for a while by other processes.
    When I run my command line program, it can not find the function I added to the existing class. But I am 100% sure I have overwrote the existing class file with my new copy. It looks like the old class file is still in effect.
    How can I instruct the JVM to load my new class file, not using the old one(maybe it is cached in memory, and didn't get refreshed)
    Welcome any suggestions. I have run out of idea. (BTW: It is infeasible for me to restart the computer)

    Classes are loaded by an object called a ClassLoader which stores all the classes it loads in some kind of internal Map object. If you ask the same ClassLoader for a class it's already loaded it will given you the old one.
    The only way to drop a class is to drop the ClassLoader which loaded it and create a new one to load a new version.
    What you need to do is to put the class file in question is a directory or jar which isn't on the class path. And make sure that no class file of the same name exists on the classpath (because that will be loaded in preference).
    Then you create a java.net.URLClassLoader pointing to the directory or jar (use FIle.toURL() to turn a file into a URL).
    Then call loadClass on that to load your class file. Then you'll probably have to call newInstance() on the class object to create an instance.
    Of course, if new method signatures are added you'll have to access them using Method objects, since they won't be know about at compile time.

  • New class installation in jre

    hi,
    could anyone tell me how intall new classes(as jar files) in jre. copying the file in lib and adding the CLASSPATH works for j2sdk. but appletviewer does not recognize the classes. any idea how to install the jars with j2re.
    thanks
    bala

    try putting the .jar in jre/lib/ext directory.

Maybe you are looking for

  • How do you open a link within a PDF in a new window?

    I created a PDF that will be viewed in a browser. Is there a way to set the links within the PDF to open in a new window?

  • Windows 8 Saying iPad drive needs to be scanned.

    When I connect iPad to new computer (Windows 8) receive the message - "There is a problem with this device. Scan the drive and fix it now". iPad worked ok on old computer. Can anyone help?.

  • CONNECTION HELP NEEDED

    Whenever I try to log into ichat it says I can't because the connection has timed out. I believe it could be because I am at school and something I need to do something with the network to make ichat run. I know the school doesn't block ichat so that

  • How to pick the wage type (repeat structure) in pa0008 infotype.

    Hi all.      Iam writing code we pick the data from Pa0008-lgart Pa0008-brt01.     these two field are repeat structure.    here iam given code what we writen. select pernr           lgart           betrg             from pa0014             into tabl

  • SQL Server Analysis Services (PowerPivot) instance returned the following error:

    SQL Server Analysis Services (PowerPivot) instance returned the following error: Error Code: 3241607174 Description: A connection corresponding to the embedded PowerPivot data was not found in the Excel workbook, file 'C:\Program Files\Microsoft SQL