Create a new class which extends DataGrid

Can someone give me a simple example on how to create a new
class that extends DataGrid. Still having a little trouble
understanding classes.
Thanks for any help.
Jeremy

import mx.controls.DataGrid
public class MyGrid extends DataGrid {
It is pretty much as you would extend a class in Java

Similar Messages

  • Authoring Tool "Inherit Class" vs "New Class" vs "Extended Class" Scenario Help

    Hi Community,
    I am currently creating the ground work needed to create Self Service Portal Request Offerings to be used by end users and then take that input and automate it with Orchestrator.
    I'm pretty comfortable with the overall process of how this is done, but I was hoping to get guidance from the community to make sure that I don't waste my time by editing my existing management pack incorrectly from the beginning.
    We currently have a Whole bunch of SR and IR Templates in a Management Pack - lets call it: "Company.Templates.MP" now what I want to do is edit this MP and add new List and String Properties to hold the responses provided from the
    Self Service Portal so that I can use a Runbook Activity to feed these responses into Orchestrator.
    Now what I have done is "Extended" the existing "Service Request" and "Incident" classes and created the new properties in each extended class. Now that I have Extended the default Classes I believe that the properties now apply
    to EVERY existing and new SR and IR.
    My question is... Do you think I have done this correctly?
    I have a gut feeling that I have done it wrong and I should revert my MP changes and then instead of extending the existing IR and SR Classes which affect all existing Work Items, I should create a new SR and IR class which would then be used to create new
    Templates which are then ONLY ones that contain the new properties that would be used for Runbook Automation.
    The feedback I receive will be VERY MUCHLY appreciated...

    Answering your implicit question in the title:
    Inherit is where you create a new class that has all the properties of the parent and then some new ones also, but people can still use the parent for regular work. This is for specialization, like say you want a new type of incident to
    cover firewall problems, and need new properties for the IP and Ports from the portal.
    Extended would be where you add properties to a class that make sense for all of those and all inheriting classes. say the client has a cost of IT tracking system where every Incident and Service Request needs to be assigned a cost of effort
    code, you would create two extensions for Incident and Service request, and point them at the same enum list. you wouldn't extend WorkItem, because changes, activities, released etc wouldn't use a simple cost estimate list value, and you wouldn't inherit off
    of SR and IR because all user requests should have this property, even if some of them are blank  
    New would be a class from scratch that inherits from Entity. This is hardly ever what you want to do, because even completely new things are either work items or config items, and should, where ever possible, inherit from one of those
    basil classes
    Now to your explicit question: No, i think you've done exactly what the situation called for. every SR should have this value, even if it is empty for the historical items.
    two side notes: 1) any item that refers to the base of an extension will continue to work as expected, but  2) Offerings are always the exception. The net of these two rule of thumb guidelines is that your existing templates should continue to work
    without modification, but you may have to recreate the offering before you can use the new property in a question.  
    AFAIK you cannot extend an abstract calls (ex. Work Item), but I could be wrong.
    http://codebeaver.blogspot.dk/

  • How to create a new class

    Hi,
    I'm trying to create a new class called Questions, which has
    two properties (type and condition).
    The action script is saved in the folder myComponents under
    the project.
    When I compile the Main app, I get the following error
    message:
    "1172 Definition myComponents:Question could not be found."
    Why?
    How do you call a constructor for a new class, that is not an
    extension of an existing class?
    Regards
    /Acke
    //-----------Class----------//
    package myComponents
    // Import all classes in the mx.events package
    import mx.events.*;
    public class Question {
    // Public constructor.
    public var Question(){
    // Call the constructor in the superclass.
    //super();
    // Define properties and methods.
    // Define public vars.
    public var type:string;
    public var condition:string;
    //------Main----------//
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute"
    xmlns:MyComp="myComponents.*">
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    import mx.events.CloseEvent;
    import myComponents.Question;
    etc, etc....

    quote:
    Originally posted by:
    MannenMytenLegenden
    Hi,
    I'm trying to create a new class called Questions, which has
    two properties (type and condition).
    The action script is saved in the folder myComponents under
    the project.
    When I compile the Main app, I get the following error
    message:
    "1172 Definition myComponents:Question could not be found."
    Why?
    How do you call a constructor for a new class, that is not an
    extension of an existing class?
    Regards
    /Acke
    //-----------Class----------//
    package myComponents
    // Import all classes in the mx.events package
    import mx.events.*;
    public class Question {
    // Public constructor.
    public var Question(){
    // Call the constructor in the superclass.
    //super();
    // Define properties and methods.
    // Define public vars.
    public var type:string;
    public var condition:string;
    //------Main----------//
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute"
    xmlns:MyComp="myComponents.*">
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    import mx.events.CloseEvent;
    import myComponents.Question;
    etc, etc....
    Here is a test class I created a while back, although this
    one does extend Object it might help you out a bit with your
    constructor issue:
    package com.evilest
    import mx.controls.Alert;
    public class Testing_class extends Object
    private var message:String = new String();
    public function Testing_class(input:String) {
    this.message = input;
    public function showAlert():void {
    Alert.show(this.message, "sup");
    }

  • Creating a new "Class type" in release procedure.

    Hi guys,
    how can I create a new <b>"Class type"</b> in release procedure?

    Hi,
    But I do not know why anyone would create a new batch type for release strategies, it is totally unnecessary and provides no additional options. The class type indicates which objects can be classified and there is already one for release strategies.
    You can create a new class or add characteristics to the existing class used in the release strategy anyway.
    Ther is also NO WAY that two classes can be used in the release strategy and this new class type would not change this either???
    Steve B

  • 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?

  • Error during creating a new class diagram

    Hi everbody,
    I'm using JDeveloper 10.1.3.3.0 with ADF Faces and Toplink. I'm exposing to an error message in JDeveloper while creating a new class diagram. The error message is shown in dialog and saying "The name of the element can not be set to 'package name' as another element has got the same name in the package". I have controlled the name of the new class diagram. The name is unique in the package. Also I'm creating this new file in the package "tr.com.bilisim.class_diagram" and details part of this error message in dialog also says
    "BME-02002 : The name of the element can not be set to 'class_diagram' as another element has got the same name in the package"
    "BME-02002 : The name of the element can not be set to 'bilisim as another element has got the same name in the package"
    "BME-02002 : The name of the element can not be set to 'com' as another element has got the same name in the package"
    "BME-02002 : The name of the element can not be set to 'tr' as another element has got the same name in the package"
    As I understand from the error message, during creating a new class diagram from 'new file dialog' also tries to create the directories in relevant package (tr.com.bilisim.class_diagram).
    How can I solve this problem? Please urgent help!
    best regards...
    --baris                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    -repost
    please urgent
    --barisk                                                                                                                                                                                                                           

  • ?Is it possible to create a javafx class without extending Application class ? If yes, how

    Is it possible to create a javafx class without extending Application class ? If yes, how ?

      There is no  such thing as a javafx  class.  It is a regular  java class.  The Aapplication class is  the entry
    point  for JavaFX application.  You have to extend the Application class to create Javafx  application .

  • Creating a new class using a template class

    I am very new to Java.
    I need to make a new class by using a template class that was given to us.
    I go to File / New / Class but cannot find how to select a template class to create a new class.
    Thanks,
    gs

    gs2010 wrote:
    I am very new to Java.
    I need to make a new class by using a template class that was given to us.
    I go to File / New / Class but cannot find how to select a template class to create a new class.
    Thanks,
    gsYou need to be much more specific as to what you are trying to do.
    What is a "template class"?
    How are you trying to "go to" and "select" the template?
    Etc.

  • Creating array of objects of class which extends Thread

    getting NullPointerException
    can i not create thread array this way?
    class sample extends Thread
    { int i,id;
      public sample(int c)
       { id=c;
      public void run()
      { for(i=0;i<6;i++)
         System.out.println("Thread "+id+" "+i);
    public class thread extends Frame implements ActionListener
    {  Button b1;
       sample s[];
       thread()
       { for(int i=0;i<2;i++)
              s=new sample(i);
         setLayout(new FlowLayout());
         b1=new Button("OK");
         add(b1);
         b1.addActionListener(this);
         public void actionPerformed(ActionEvent e)
         {   b1.setEnabled(false);
              for(int i=0;i<2;i++)
              { s[i]=new sample(i);
              s[i].start();
         public static void main(String args[])
         { thread t1=new thread(); 
         t1.setVisible(true);
         t1.setSize(150,150);

    You need:
    sample [] s = new sample[2];However
    1) You should get into the habit that class names start with capital letters, variable and field names with lower case.
    2) It's not a good idea to extend Thread, make a class which implements the Runnable interface and hook a standard Thread object to that.

  • Retrieve method from class which extends JFrame

    hi, i need some help with my program.
    I have two class which both extends JFrame. The first class called security class and second class is available class.
    In the SECURITY class, i create a button to operate the AVAILABLE class and it generate a result in method Count(). I want to view the result in Frame SECURITY by calling method count() but i could manage to do it. Could somebody help me how to manage this problem?
    Thanks.

    may be you could create a instance of the class you wanted to access method from or pass the instance from one class to another.
    like this:
    public class A extends JFrame
    public B newB= new B();
    public A(){}
    public void someMethod()
    newB.someOtherMethod();
    public class B extends JFrame
    public B(){}
    public void someOtherMethod()
    i hope it is what you are looking for

  • Create a new class in pe51 form layout

    Hi experts,
                   I want to create a new form  layout in pe51 for payroll register. In standard form class maximum columns is 132 but i want
    more than 300 columns for payroll register. so its possible to to create new zform class in pe51. If its possible pls guide me.
    Thanks in advance.
    Thanks & Regards
    G.Vendhan

    Hi, I am working on the same thing and created a form in PE51 using Form class CKT0 which gives me 255 columns.  I am however having problems with finding some of the fields I need.
    Thanks.
    N

  • LoadClass    (error loading a class which extends other class  at run-time)

    Hey!
    I'm using the Reflection API
    I load a class called 'SubClass' which exists in a directory called 'subdir' at run-time from my program
    CustomClassLoader loader = new CustomClassLoader();
    Class classRef = loader.loadClass("SubClass");
    class CustomClassLoader extends ClassLoader. I have defined 'findClass(String className)' method in CustomClassLoader.
    This is what 'findClass(String className)' returns:
    defineClass (className,byteArray,0,byteArray.length);
    'byteArray' is of type byte[] and has the contents of subdir/SubClass.
    the problem:
    The program runs fine if SubClass does not extend any class.
    If however, SubClass extends another class, the program throws a NoClassDefFoundError. How is it conceptually different?
    Help appreciated in Advance..
    Thanks!

    Because i'm a newbie to the Reflection thing, i'm notI don't see reflection anywhere. All I see is class loading.
    sure what role does the superclass play when i'm
    trying to load the derived class and how to get away
    with the errorWell... hint: all the superclass's stuff is not copied into the subclass.
    I am quite sure it fails to load the superclass because of classpath issues.

  • Adding a JPanel from one class to another Class (which extends JFrame)

    Hi everyone,
    So hopefully I go about this right, and I can figure out what I'm doing wrong here. As an exercise, I'm trying to write a Tic-Tac-Toe (TTT) game. However, in the end it will be adaptable for different variations of TTT, so it's broken up some. I have a TTTGame.java, and TTTSquareFrame.java, and some others that aren't relavent.
    So, TTTGame:import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import joshPack.jUtil.*;
    public class TTTGame extends JFrame
         private Integer sides = 3;
         private TTTSquareFrame mainSquare;
         private TTTGame newGame;
         private Container contents;
         private JPanel mainSquarePanel, addPanel;
         public static void main(String [] args)
              TTTGame newGame = new TTTGame();
              newGame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         public TTTGame()
              super("Tic-Tac-Toe");
              contents = getContentPane();
              contents.setLayout(new FlowLayout());
              addPanel = startSimple();
              if(!addPanel.isValid())
                   System.out.println("Something's wrong");
              contents.add(addPanel);
              setSize(300, 300);
              setVisible(true);
         public JPanel startSimple()
              mainSquare = new TTTSquareFrame(sides);
              mainSquarePanel = mainSquare.createPanel(sides);
              return mainSquarePanel;
    }and TTTSquareFrame:import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import joshPack.jUtil.Misc;
    public class TTTSquareFrame
         private JPanel squarePanel;
         private JButton [] squares;
         private int square, index;
         public TTTSquareFrame()
              System.out.println("Use a constructor that passes an integer specifying the size of the square please.");
              System.exit(0);
         public TTTSquareFrame(int size)
         public JPanel createPanel(int size)
              square = (int)Math.pow(size, 2);
              squarePanel = new JPanel();
              squarePanel.setLayout(new GridLayout(3,3));
              squares = new JButton[square];
              System.out.println(MIN_SIZE.toString());
              for(int i = 0; i < square; i++)
                   squares[i] = new JButton();
                   squares.setRolloverEnabled(false);
                   squares[i].addActionListener(bh);
                   //squares[i].setMinimumSize(MIN_SIZE);
                   squares[i].setVisible(true);
                   squarePanel.add(squares[i]);
              squarePanel.setSize(100, 100);
              squarePanel.setVisible(true);
              return squarePanel;
    }I've successfully added panels to JFrame within the same class, and this is the first time I'm modularizing the code this way. The issue is that the frame comes up blank, and I get the message "Something's wrong" and it says the addPanel is invalid. Originally, the panel creation was in the constructor for TTTSquareFrame, and I just added the mainSquare (from TTTGame class) to the content pane, when that didn't work, I tried going about it this way. Not exactly sure why I wouldn't be able to add the panel from another class, any help is greatly appreciated.
    I did try and cut out code that wasn't needed, if it's still too much let me know and I can try and whittle it down more. Thanks.

    Yea, sorry 'bout that, I just cut out the parts of the files that weren't relevant but forgot to compile it just to make sure I hadn't left any remnants of what I had removed. For whatever it's worth, I have no idea what changed, but something did and it is working now. Thanks for your help, maybe next time I'll post an actual question that doesn't somehow magically solve itself.
    EDIT: Actually, sorry, I've got the panel working now, but it's tiny. I've set the minimum size, and I've set the size of the panel, so...why won't it respond to that? It almost looks like it's being compressed into the top of the panel, but I'm not sure why.
    I've compressed the code into:
    TTTGame.java:
    import java.awt.*;
    import javax.swing.*;
    public class TTTGame extends JFrame
         private Integer sides = 3;
         private TTTSquareFrame mainSquare;
         private TTTGame newGame;
         private Container contents;
         private JPanel mainSquarePanel, addPanel;
         public static void main(String [] args)
              TTTGame newGame = new TTTGame();
              newGame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         public TTTGame()
              super("Tic-Tac-Toe");
              contents = getContentPane();
              contents.setLayout(new FlowLayout());
              mainSquare = new TTTSquareFrame(sides.intValue());
              contents.add(mainSquare);
              setSize(400, 400);
              setVisible(true);
    }TTTSquareFrame.java
    import java.awt.*;
    import javax.swing.*;
    public class TTTSquareFrame extends JPanel
         private JButton [] squares;
         private int square, index;
         private final Dimension testSize = new Dimension(50, 50);
         public TTTSquareFrame(int size)
              super();
              square = (int)Math.pow(size, 2);
              super.setLayout(new GridLayout(size, size));
              squares = new JButton[square];
              for(int i = 0; i < square; i++)
                   squares[i] = new JButton();
                   squares.setMinimumSize(testSize);
                   squares[i].setVisible(true);
                   super.add(squares[i]);
              setSize(200, 200);
              setVisible(true);
    I've made sure the buttons are smaller than the size of the panel, and the panel is smaller than the frame, so...
    Message was edited by:
    macman104

  • Creating a new class instance in the target VM exception

    Hello,
    The following error appeared when i was trying to instantiate a new object by "new", After the error was thrown , everything just hanged ....
    [email protected](java.lang.String)+-1 in thread Thread-0
    I tried creating a new instance of any class i wrote it gave me the same behaviour. But when i create a new instance of any of the JRE's (BufferedReader for example) classes it runs normally.
    The error seems to be thrown only in dynamic loading because i tried inheriting from a class i wrote and invoking super() it executed normally. Also the problem is not from setting the class path because i am correctly passing the class path to the target virtual machine.
    So what is the problem ? Any help is greatly appreciated.
    Regard,
    Ahmed Ashmawy

    The hanging part is solved , it was a mistake when handling exception events. But anyways i would appreciate it if i knew why the error is being thrown. It just continues normally as if nothing happened

  • Invoke a panel object in a class which extends JFrame

    I have a class LoginUI which extends JFrame and another class NewUserUI which extends JPanel. The LoginUI contains a button which when clicked should display the NewUserUI panel in a separate window. How should I invoke the NewUserUI object in the LoginUI class?

    One possibility would be the use of a JOptionPane containing the JPanel.
    Cheers
    DB

Maybe you are looking for