Classloader: linking a class

Hi,
I'm trying to manipulate the class loader to obtain something "strange". Imagine that you've got:
public class A
public class B extends A
and a class that is the application
public class APPLICATION extends A
Now the class A is a library class an the class B is a new version of the same class.
Imagine that the application could run on system where only A is presents and on system
where both A,B are presents. If B is present extending B is better, but if I write:
public class APPLICATION extends B
where B is not present the application could not run.
My question is: can I decide what class to extends at the loading time?
An answer could be "recompile". Infact I can test which class is presents and recompile the application
class setting what class to extends, but I don't want to recompile.
An other idea is this: to load the class the system must instatiate base class first, then
the application class. If I can decide what class to load as base class I've reached the goal!
But the class loader (java.lang.classloader) doesn't allow user to ridefine the linking method
(that is resolveclass) because it's native. The only method to define is loadclass but nothing about linking
classes is made by this method.
How can I solve this matter?
Thanks

Rather than manipulate the classloader to deal with dynamic inheritance, why not utilize composition instead?
Let your application class contain an object of class a as well as an object of class b. when you try to instantiate b, if it doesn't exist, trap the NoClassDefFoundError, and instantiate a instead.
will that get you where you need to be?

Similar Messages

  • Link between Class and characteristics created for that class

    Hi All,
    Is there any table that I can look at to find a link between class and the characteristics created for that class. For all the list of characteristics created I am refereing to CABN table but my requirement is to find the logic to see all the characteristics created for a class. Can anyone suggest me the right table to look at?
    Regards,
    Shane

    Hi,
    I would like to thank you for your quick response. So based on your thoughts, here is the process i followed to find the characteristics for a existing class,  took the Internal class number and used the KSML table to find all the Characteristics created for that class.
    To find the list of values assigned to that characteristics, used the AUSP table for that characteristics internal number.
    Thank you again for your inputs
    Shane.

  • Implementation of Linked List class

    I am trying to implement the Linked List class for one week, but I couldn't figure it out. If you know, please let me know.

    Here is an example of a linked list. Hope that will help.
    // define a node of a linked list
    public class Node
    public int data; // point to data
    public Node next; // pointer to next node or point to null if end of list
    // listTest1
    public class ListTest1
    public static void main(String[] args)
    Node list;
    list = new Node();
    list.data = 3;
    list.next = new Node();
    list.next.data = 7;
    list.next.next = new Node();
    list.next.next.data = 12;
    list.next.next.next = null;
    Node current = list;
    while (current != null) {
    System.out.print(current.data + " ");
    current = current.next;
    System.out.println();
    // other listnode
    public class ListNode
    public int data;
    public ListNode next;
    public ListNode()
    // post: constructs a node with data 0 and null link
    this(0, null);
    public ListNode(int value)
    // post: constructs a node with given data and null link
    this(value, null);
    public ListNode(int value, ListNode link)
    // post: constructs a node with given data and given link
    data = value;
    next = link;
    Contents of ListTest2.java
    public class ListTest2
    public static void main(String[] args)
    ListNode list = new ListNode(3, new ListNode(7, new ListNode(12)));
    ListNode current = list;
    while (current != null) {
    System.out.print(current.data + " ");
    current = current.next;
    System.out.println();

  • Linking a class to a symbol

    I have a simple progress bar symbol (ProgBar) in the library of main.fla. If I don't define a class and allow Flash to assign a placeholder class of ProgBar, then the symbol displays ok using
    progBar = new ProgBar();
    addChild(progBar);
    If I define a class, even the basic empty version below, I get the following error:
    ReferenceError: Error #1056: Cannot create property percent_txt on ProgBar.
    at flash.display::Sprite/constructChildren()
    at flash.display::Sprite()
    at flash.display::MovieClip()
    Class code:
    package {
    import flash.display.*;
    import flash.text.*;
    public class ProgBar extends MovieClip {
      public function ProgBar(): void {
    percent_txt is a text field I've given an instance name to. If I delete the text field (or its instance name) the error changes to reference the next item in the symbol and so on until there are none left!
    What have I missed?

    Well, yes, I thought it was a great plan! As part of my AS3/OOP education I'm trying to design a progress bar symbol with an associated class file for use in various projects. So I have progBar.fla containing a symbol, progBarMC, linked to class file ProgBar.as (which currently only traces "ProgBar constructor" as each instance is created). To test this I have main.fla and its document class Main.as. I've dragged a copy of progBarMC into the library of main.fla. Main.as looks like this:
    package {
    import flash.display.MovieClip;
    import flash.text.*;
    public class Main extends MovieClip {
      var progBar:MovieClip;
      public function Main() {
       progBar = new ProgBar();
       addChild(progBar);
    This only seemed to work if the symbol files were in the same folder as main.fla, but I've fixed that now - I hadn't set a class path for the symbol files.
    Your question sort of implies that this might not be an ideal approach. Any advice gratefully received!

  • De-linking (Valuation class & GL A/c) automatic posting in Invoice booking

    Experts,
    I have a issue regarding link between FI & MM
    From what I understand,
    there is a link between Service & Valuation class
    & also a link between valuation class & GL.
    This link enables automatic FI line item posting while invoice booking.
    My question:
    1. Can we break the linkage between valuation class & GL i.e. we want to stop the automatic posting
    2. What is the effect of above
    3. Would you advise to do this .. ? Why?
    Regards,
    KPS007

    Hi,
    SAP standard process are the best business practises and it should changed only when we have genuine business problem and not for people issue.
    There are several scenarios will occur during MIGO and MIRO. For each scenario system should determine a correct Inventory account, GR/IR clearing account, Price difference account and etc. First you need to prepare an excel sheet with all your possible business scenario, valuation area/valuation grouping code and their respective GL accounts. Once you have listed out all the scenarios and correct GL accounts, you can configure the system as per your requirement. Initial home work is needed to avoid any difference in account posting. Hence try to fix the source of your problem rather than changing the best practise. Account determination is vast and it cannot be explained here but please refer the below link.
    http://help.sap.com/saphelp_46c/helpdata/en/12/1a39516e36d1118b3f0060b03ca329/content.htm
    Regards,
    Senthil

  • Link between classes: Reference Error

    Hi,
    I am still trying to create a movie clip array to make a list of objects appear on stage and have the user interact with them.
    This will be my game loop class called "LetterArray()".
    My main class is called "BugGoopFSGame()".
    After I add the line of code below into my LetterArray(). as class file I get the error message below:
    Code entered:
    private var  lettersL1:Array = new Array[a,f,g,h,i,n,o,s,t];
    This is the error message I get:
    ReferenceError: Error #1069: Property [object T] not found on S and there is no default value.
        at LetterArray()
        at BugGoopFSGame()
    I am sure the reference I use between the two files are not good. Can you please tell me what code I should add and where.
    Thanks for your help!
    Charine
    This is the code in my main class - BugGoopFSGame()
    package
        import flash.display.*;
        import flash.utils.Timer;
        import flash.events.*;
        import flash.events.MouseEvent;
        import flash.media.Sound;
        import flash.events.Event;
        import flash.media.SoundChannel;
        import flash.media.SoundMixer;
        import flash.media.SoundTransform;
        import flash.text.*;
        import flash.net.URLRequest;
        public class BugGoopFSGame extends MovieClip
            public var mybackground:BackGround;
            public var letterArray:LetterArray = new LetterArray(stage); //this is how I link from main to gameloop
    This is the coce in my gameloop class - LetterArray()
    package
        import flash.display.*;
        import flash.events.*;
        import flash.text.*;
        import flash.utils.Timer;
        import flash.media.Sound;
        import flash.media.SoundChannel;
        import flash.net.URLRequest;
        public class LetterArray extends MovieClip
            private var _stage:Stage; //this reference works well to the main file. Should I somehow link it to the errorous code below?
            /*Movie clips that need to go into an array    */
            //level 1
            public var a:A = new A();
            public var f:F = new F();
            public var g:G = new G();
            public var h:H = new H();
            public var i:I = new I();
            public var n:N = new N();
            public var o:O = new O();
            public var s:S = new S();
            public var t:T = new T();
            private var letterArray:Array;
            private var  lettersL1:Array = new Array[a,f,g,h,i,n,o,s,t]; //this is the line that causes the error. I am sure it is because I need to add something to the main class.

    if, for example, A is a class name, you should use "A" and then use getDefinitionByName() to retrieve the class reference from the string.
    private var  lettersL1:Array = new Array['A','F','G','H','I','N','O','S','T'];
    for(var i:int=0;i<lettersL1.length;i++){
    var C:Class=Class(getDefinitionByName(lettersL1[i]));  // import flash.utils.getDefinitionByName
    var c:*=new C(); // create instances from the classes in lettersL1
    // do whatever with c
    or, move those instanciation statements into your LetterArray constructor or somewhere beyond like:
    package
        import flash.display.*;
        import flash.events.*;
        import flash.text.*;
        import flash.utils.Timer;
        import flash.media.Sound;
        import flash.media.SoundChannel;
        import flash.net.URLRequest;
        public class LetterArray extends MovieClip
            private var _stage:Stage; //this reference works well to the main file. Should I somehow link it to the errorous code below?
            private var letterArray:Array;
            private var  lettersL1:Array; //this is the line that causes the error. I am sure it is because I need to add something to the main class.
            public function LetterArray(ss:Stage):void{
                var a:A = new A();
                var f:F = new F();
                 etc
                lettersL1 = [a,f,...]
                _stage = ss;

  • How to use gotoandplay scene link using class property (external code.as)

    Hello
    I am using ‘gotoandplay’ scene by scene link using this code. If I use this in the same time line (internal), it’s working properly but when I use this code in as a class, I got this error
    Call to a possibly undefined method MovieClip.
    I use this code in time timeline
    b_enter.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_enter1);
    function fl_ClickToGoToScene_enter1(event:MouseEvent):void
                MovieClip(this.root).gotoAndPlay("p menu", "Menu");
    I use this code in class
    package  {
                import flash.display.SimpleButton;
                public class next extends SimpleButton {
                            public function next() {
                                        // constructor code
                                        MovieClip(this.root).gotoAndStop("p2", "page2")
    u can download the flash file using this link
    http://www.delta-adv.com/nav/np.rar

    oops, i didn't notice you were trying to add that code in a button class and were nesting named functions.  use:
    package  {
                        import flash.display.SimpleButton;
                        import flash.display.MovieClip;
                        import flash.events.MouseEvent;
                        import flash.events.Event;
                        public class np extends SimpleButton {
                        public function np() {
    this.addEventListener(Event.ADDED_TO_STAGE,init);
    private function init(e:Event):void{
    MovieClip(this.root).addEventListener(Event.RENDER,renderF);
                                    this.stage.invalidate();
                                    MovieClip(this.root).nextScene();
    private function renderF(e:Event):void{
                                              MovieClip(this.root).gotoAndStop(5);

  • JavaDoc HTML link of  classes in Java class diagram not correct

    Hi,
    I created a Java class diagram in a certain package (e.g. com.mycompany.p1) and placed some classes on this diagram from the same package and from other packages. Then I created JavaDocs. When I click on the classes in the created JavaDoc diagram, only the links of the classes in the same package as the diagram (com.mycompany.p1) wor correctly. When I click on a class outside this package I get an error message that the file is not found. It looks for the class documentation in the package of the diagram and this is obviousely wrong!
    Is there a property I missed to set or is it a bug?
    Thanks for help
    Thomas

    Hi Thomas,
    I don't use the diagrammers much, so I cannot comment on this directly; however, based on your description, it does sound like a defect. Do you have access to Oracle Support to file an SR?
    John

  • How do I dynamically load a SWF that was compiled from an Fla with a linked external class file

    I am dynamically loading external SWFs in a Main Fla in response to clicks on a menu.
    The loading code is standard and works fine for all of the SWFs except one. When I try to load it I get the following error:
    Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.
    I am certain that the URL to the problem SWF is correct. The SWF itself doesn't load any other SWFs or images.
    The problem SWF is linked to an external class file and compiled with it.
    i.e. in the properties panel of the main timeline of the problem SWF's Fla I have entered the path to the external class.
    1. there is no problem compiling this SWF with the class (it works fine by itself)
    2. if I remove the external class from the properties panel and don't use it the resulting SWF imports without a problem into the Main Fla mentioned before
    So the problem seems to be the fact that the external class is linked in the properties panel. Is this a path problem?
    Would appreciate any suggestions,
    Thanks!

    despite what you say, that loaded swf most likely is loading something and that's the cause of the error.
    you could test that by putting the main swf's embedding html file in the same directory with problematic swf.  if the problem is as explained above, you'll have no problem when the main html is in the same directory with the loaded swf.

  • HELP: ClassLoader cannot find .class file

    Hi,everybody:
    I'm working on a project of auto-testing, and need the java.lang.ClassLoader to load the to-be-tested java file.
    It can be simply described as the following code:
    public class tt {
    public static void main(String[] args) throws Exception{
    Class testClass;
    String testClassName="TestExample";
    String path = System.getProperty("java.io.tmpdir");
    URL[] urls = {new URL("file://" + path )};
    ClassLoader testCaseLoader = new URLClassLoader(urls);
    testClass = testCaseLoader.loadClass(testClassName);
    The process is that, put the to-be-tested file to a certain directory, compile it, and finally load it. For example, in the above code, i want to load the class "TestExample".
    But it always report the exception: java.lang.ClassNotFoundException: TestExample .
    Note, cannot put the to-be-loaded .class file in the same directory with the loading-code, or the loading-code will defaultly find the to-be-loaded .class file , and there would be no exception.
    I use jdk6.
    I really cannot figure out the problem. Could anyone help me? Thanks a lot.

    MyCoy wrote:
    To malcolmmc:
    thanks. but what is FQN ?
    Fully Qualified Name
    That is, the class name including the package name. Eg java.lang.Object

  • Variant Config. - Max # of components that can be linked to Class Item (K)

    Hello,
    I would like to know if there is any limit to the Maximum # of components that can be linked to a Class Item (K) of a Super BOM.
    i.e i have a scenario where am creating a Class Item (K) in a Super BOM and for this Class Item i might end up in having more than 3000 materials linked to the Class Item. The actual component will get selected based on a certain Characterstic value.
    I want to know if there would be any issue if i have more than 3000 materials linked to a Class Item.
    Appreciate you input in this Regard.
    Any kind of related answer would be extremely helpful.
    Best Regards,
    Bharat.

    Thanks Sateesh,
    I was wondering if anyone had same kind of scenario in their projects,  if so what is their feedback.
    The reason i want to know earlier is it would be too late in the game if i chosen this route and went ahead configuring the System.  We may not be having complete set of materials in our Test Scenarios.
    The only environment i would see the complete setup as per our Project details is production, unless otherwise we plan to do something else.
    Appreciate inputs in this regard.
    Regards,
    Bharat.
    Edited by: bharat nallamilli on May 2, 2008 5:29 PM

  • Linking Swing classes

    I need the link the two classes I have pasted below. Please examine the code, I have created a new object of the type, the second class, but it doesnt execute when the option dialog is pressed, please advise on how i can get it to work... but classes are error free and work. Help would be much appreciated
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class MainMenu extends JFrame implements ActionListener {
    JButton exRwButton;
    JButton exQsButton;
    JButton dspExButton;
    JButton exitButton;
    JButton exInButton;
    JLabel MainMenuLabel;
    JFrame frame;
    public MainMenu() {
    MainMenuLayout customLayout = new MainMenuLayout();
    getContentPane().setFont(new Font("Helvetica", Font.PLAIN, 12));
    getContentPane().setLayout(customLayout);
    exRwButton = new JButton("Excercise Review");
    getContentPane().add(exRwButton);
              exRwButton.addActionListener(this);
              exQsButton = new JButton("Excercise Questionaire");
    getContentPane().add(exQsButton);
    exQsButton.addActionListener(this);
              dspExButton = new JButton("Display Current Excercise Plan");
    getContentPane().add(dspExButton);
    dspExButton.addActionListener(this);
    exitButton = new JButton("Exit Excercise Asistant");
    getContentPane().add(exitButton);
    exitButton.addActionListener(this);
    exInButton = new JButton("Initial Questionaire");
    getContentPane().add(exInButton);
              exInButton.addActionListener(this);
              MainMenuLabel = new JLabel("Excercise Asistant Main Menu");
    getContentPane().add(MainMenuLabel);
    setSize(getPreferredSize());
    public static void main(String args[]) {
    MainMenu window = new MainMenu();
    window.setTitle("MainMenu");
    window.pack();
    window.show();
    public void actionPerformed(ActionEvent e)
         MainMenu frame = new MainMenu();
         //dispose();
         Object source = e.getSource();
         if(source instanceof JButton)
              if(source == exRwButton)
                   Object[] options1 = {"Yes", "Cancel"};
    JOptionPane.showOptionDialog(
    frame, "Would you like to perform an Excercise Plan Review?",
    "Confirm Selection",
    JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options1, options1[0]);
              else if (source == exQsButton)
                   Object[] options2 = {"Yes", "Cancel"};
    JOptionPane.showOptionDialog(frame, "Would you like to perform an Excercise Plan Questionaire?",
    "Confirm Selection",
    JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options2, options2[0]);
              else if(source == exInButton)
                   Object[] options3 = {"Yes", "Cancel"};
    JOptionPane.showOptionDialog(
    frame, "Would you like to perform an Intial Personal Questionaire?",
    "Confirm Selection",
    JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options3, options3[0]);
    Menu1 me = new Menu1(); // i have added this statement to open the next java file with
                                                 //the class name Menu1, but it doesnt seam to work
              else if(source == dspExButton)
                   Object[] options4 = {"Yes", "Cancel"};
    JOptionPane.showOptionDialog(
    frame, "Would you like to display your current Excecise Plan?",
    "Confirm Selection",
    JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options4, options4[0]);
              else if(source == exitButton)
                   Object[] options5 = {"Yes", "Cancel"};
    JOptionPane.showOptionDialog(
    frame, "Are you sure you want to exit the excercise assistant?",
    "Confirm Selection",
    JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options5, options5[0]);
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    class MainMenuLayout implements LayoutManager {
    public MainMenuLayout() {
    public void addLayoutComponent(String name, Component comp) {
    public void removeLayoutComponent(Component comp) {
    public Dimension preferredLayoutSize(Container parent) {
    Dimension dim = new Dimension(0, 0);
    Insets insets = parent.getInsets();
    dim.width = 510 + insets.left + insets.right;
    dim.height = 242 + insets.top + insets.bottom;
    return dim;
    public Dimension minimumLayoutSize(Container parent) {
    Dimension dim = new Dimension(0, 0);
    return dim;
    public void layoutContainer(Container parent) {
    Insets insets = parent.getInsets();
    Component c;
    c = parent.getComponent(0);
    if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+72,240,24);}
    c = parent.getComponent(1);
    if (c.isVisible()) {c.setBounds(insets.left+264,insets.top+72,240,24);}
    c = parent.getComponent(2);
    if (c.isVisible()) {c.setBounds(insets.left+264,insets.top+112,240,24);}
    c = parent.getComponent(3);
    if (c.isVisible()) {c.setBounds(insets.left+168,insets.top+160,184,24);}
    c = parent.getComponent(4);
    if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+112,240,24);}
    c = parent.getComponent(5);
    if (c.isVisible()) {c.setBounds(insets.left+152,insets.top+24,208,24);}
    //class which precious code should connect to i.e. open when selection is made from option dialog
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Menu1 extends JFrame {
    JLabel genderLabel;
    JLabel titleLabel;
    JLabel iniQLabel;
    JLabel ageLabel;
    JComboBox ageCombobox;
    ButtonGroup cbg;
    JRadioButton radio_1;
    JRadioButton radio_2;
    JLabel weightLabel;
    JComboBox weightCombobox;
    JLabel heightLabel;
    JComboBox heightCombobox2;
    JComboBox heightCombobox1;
    JLabel q1Label;
    JComboBox q1Combobox;
    JLabel q2Label;
    JComboBox q2Combobox;
    JLabel q3Label;
    JComboBox q3Combobox;
    JLabel q1Label2;
    JLabel q4Label;
    JComboBox q4Combobox;
    JLabel q4Label2;
    JLabel q5Label;
    JComboBox q5Combobox;
    JButton submitButton;
    JLabel decisionLabel;
    JLabel label_2;
    JLabel decisionLabel2;
    public Menu1() {
    Menu1Layout customLayout = new Menu1Layout();
    getContentPane().setFont(new Font("Helvetica", Font.PLAIN, 12));
    getContentPane().setLayout(customLayout);
    genderLabel = new JLabel("Gender");
    getContentPane().add(genderLabel);
    titleLabel = new JLabel("Please answer the following questions:");
    getContentPane().add(titleLabel);
    iniQLabel = new JLabel("Personal Questions");
    getContentPane().add(iniQLabel);
    ageLabel = new JLabel("Age Range");
    getContentPane().add(ageLabel);
    ageCombobox = new JComboBox();
    ageCombobox.addItem("Select");
    ageCombobox.addItem("16 - 20");
    ageCombobox.addItem("20 - 25");
    ageCombobox.addItem("25 - 30");
    ageCombobox.addItem("30 - 40");
    ageCombobox.addItem("40 - 50");
    ageCombobox.addItem("50+");
    getContentPane().add(ageCombobox);
    cbg = new ButtonGroup();
    radio_1 = new JRadioButton("Male", false);
    cbg.add(radio_1);
    getContentPane().add(radio_1);
    radio_2 = new JRadioButton("Female", false);
    cbg.add(radio_2);
    getContentPane().add(radio_2);
    weightLabel = new JLabel("Weight Range");
    getContentPane().add(weightLabel);
    weightCombobox = new JComboBox();
    weightCombobox.addItem("Select");
    weightCombobox.addItem("40 - 50");
    weightCombobox.addItem("50 - 60");
    weightCombobox.addItem("60 - 70");
    weightCombobox.addItem("70 - 80");
    weightCombobox.addItem("80 - 90");
    weightCombobox.addItem("90 - 120");
    weightCombobox.addItem("120+");
    getContentPane().add(weightCombobox);
    heightLabel = new JLabel("Height Range");
    getContentPane().add(heightLabel);
    heightCombobox2 = new JComboBox();
    heightCombobox2.addItem("cm");
    heightCombobox2.addItem("10");
    heightCombobox2.addItem("20");
    heightCombobox2.addItem("30");
    heightCombobox2.addItem("40");
    heightCombobox2.addItem("50");
    heightCombobox2.addItem("60");
    heightCombobox2.addItem("70");
    heightCombobox2.addItem("80");
    heightCombobox2.addItem("90");
    getContentPane().add(heightCombobox2);
    heightCombobox1 = new JComboBox();
    heightCombobox1.addItem("Metres");
    heightCombobox1.addItem("0");
    heightCombobox1.addItem("1");
    heightCombobox1.addItem("2");
    getContentPane().add(heightCombobox1);
    q1Label = new JLabel("How many hours a week would would you like to excercise?");
    getContentPane().add(q1Label);
    q1Combobox = new JComboBox();
    q1Combobox.addItem("Hours");
    q1Combobox.addItem("1");
    q1Combobox.addItem("2");
    q1Combobox.addItem("3");
    q1Combobox.addItem("4");
    q1Combobox.addItem("5");
    q1Combobox.addItem("10");
    q1Combobox.addItem("15");
    q1Combobox.addItem("20");
    getContentPane().add(q1Combobox);
    q2Label = new JLabel("What kind of excercise would suit you best?");
    getContentPane().add(q2Label);
    q2Combobox = new JComboBox();
    q2Combobox.addItem("Excercise Type");
    q2Combobox.addItem("Sports Activity");
    q2Combobox.addItem("Group Sports");
    q2Combobox.addItem("Aerobic");
    q2Combobox.addItem("Anaerobic");
    getContentPane().add(q2Combobox);
    q3Label = new JLabel("if your choose \"Aerobic\" please specify type.");
    getContentPane().add(q3Label);
    q3Combobox = new JComboBox();
    q3Combobox.addItem("Aerobic Types");
    q3Combobox.addItem("Running");
    q3Combobox.addItem("Circuit Training");
    q3Combobox.addItem("Swimming");
    q3Combobox.addItem("Stair Climbing");
    getContentPane().add(q3Combobox);
    q1Label2 = new JLabel("(Active hours per week for adult human is 60hrs approx)");
    getContentPane().add(q1Label2);
    q4Label = new JLabel("If you chose \"Anaerobic\" please specify type.");
    getContentPane().add(q4Label);
    q4Combobox = new JComboBox();
    q4Combobox.addItem("Anerobic Type");
    q4Combobox.addItem("Free Weights");
    q4Combobox.addItem("General Weight Training");
    q4Combobox.addItem("General Resistance");
    getContentPane().add(q4Combobox);
    q4Label2 = new JLabel("Note. Genral Resistance is for people whom have access to gym equipment");
    getContentPane().add(q4Label2);
    q5Label = new JLabel("What is the main Purpose of your Excercise Plan, What is your main excercise focus, ");
    getContentPane().add(q5Label);
    q5Combobox = new JComboBox();
    q5Combobox.addItem("Goals");
    q5Combobox.addItem("Muscle Gain");
    q5Combobox.addItem("Fat Loss");
    q5Combobox.addItem("Weight Loss");
    q5Combobox.addItem("Increased Fitness");
    getContentPane().add(q5Combobox);
    submitButton = new JButton("Submit");
    getContentPane().add(submitButton);
    decisionLabel = new JLabel("When you have filled out questionaire press submit button to go back to the main");
    getContentPane().add(decisionLabel);
    label_2 = new JLabel("please select most appropriate option.");
    getContentPane().add(label_2);
    decisionLabel2 = new JLabel("menu where you can select the Excercise Questionsaire");
    getContentPane().add(decisionLabel2);
    setSize(getPreferredSize());
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    public static void main(String args[]) {
    Menu1 window = new Menu1();
    window.setTitle("Menu1");
    window.pack();
    window.show();
    class Menu1Layout implements LayoutManager {
    public Menu1Layout() {
    public void addLayoutComponent(String name, Component comp) {
    public void removeLayoutComponent(Component comp) {
    public Dimension preferredLayoutSize(Container parent) {
    Dimension dim = new Dimension(0, 0);
    Insets insets = parent.getInsets();
    dim.width = 594 + insets.left + insets.right;
    dim.height = 593 + insets.top + insets.bottom;
    return dim;
    public Dimension minimumLayoutSize(Container parent) {
    Dimension dim = new Dimension(0, 0);
    return dim;
    public void layoutContainer(Container parent) {
    Insets insets = parent.getInsets();
    Component c;
    c = parent.getComponent(0);
    if (c.isVisible()) {c.setBounds(insets.left+256,insets.top+72,64,16);}
    c = parent.getComponent(1);
    if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+16,272,16);}
    c = parent.getComponent(2);
    if (c.isVisible()) {c.setBounds(insets.left+32,insets.top+48,120,16);}
    c = parent.getComponent(3);
    if (c.isVisible()) {c.setBounds(insets.left+32,insets.top+72,96,16);}
    c = parent.getComponent(4);
    if (c.isVisible()) {c.setBounds(insets.left+128,insets.top+72,88,24);}
    c = parent.getComponent(5);
    if (c.isVisible()) {c.setBounds(insets.left+256,insets.top+88,88,16);}
    c = parent.getComponent(6);
    if (c.isVisible()) {c.setBounds(insets.left+256,insets.top+104,88,16);}
    c = parent.getComponent(7);
    if (c.isVisible()) {c.setBounds(insets.left+32,insets.top+128,96,16);}
    c = parent.getComponent(8);
    if (c.isVisible()) {c.setBounds(insets.left+128,insets.top+128,88,24);}
    c = parent.getComponent(9);
    if (c.isVisible()) {c.setBounds(insets.left+256,insets.top+128,80,16);}
    c = parent.getComponent(10);
    if (c.isVisible()) {c.setBounds(insets.left+432,insets.top+128,72,24);}
    c = parent.getComponent(11);
    if (c.isVisible()) {c.setBounds(insets.left+360,insets.top+128,72,24);}
    c = parent.getComponent(12);
    if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+168,512,16);}
    c = parent.getComponent(13);
    if (c.isVisible()) {c.setBounds(insets.left+32,insets.top+184,120,24);}
    c = parent.getComponent(14);
    if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+216,512,16);}
    c = parent.getComponent(15);
    if (c.isVisible()) {c.setBounds(insets.left+32,insets.top+232,168,24);}
    c = parent.getComponent(16);
    if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+264,512,16);}
    c = parent.getComponent(17);
    if (c.isVisible()) {c.setBounds(insets.left+32,insets.top+280,168,24);}
    c = parent.getComponent(18);
    if (c.isVisible()) {c.setBounds(insets.left+160,insets.top+184,376,16);}
    c = parent.getComponent(19);
    if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+320,512,16);}
    c = parent.getComponent(20);
    if (c.isVisible()) {c.setBounds(insets.left+32,insets.top+360,128,24);}
    c = parent.getComponent(21);
    if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+336,512,16);}
    c = parent.getComponent(22);
    if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+408,512,16);}
    c = parent.getComponent(23);
    if (c.isVisible()) {c.setBounds(insets.left+32,insets.top+456,176,24);}
    c = parent.getComponent(24);
    if (c.isVisible()) {c.setBounds(insets.left+208,insets.top+552,104,24);}
    c = parent.getComponent(25);
    if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+504,512,16);}
    c = parent.getComponent(26);
    if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+424,512,16);}
    c = parent.getComponent(27);
    if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+520,512,16);}

    Compare the code in your listenerMenu1 me = new Menu1(); // i have added this statement to open the next java file with
    //the class name Menu1, but it doesnt seam to workwith the code in the main method of Menu1Menu1 window = new Menu1();
    window.setTitle("Menu1");
    window.pack();
    window.show();See anything missing above?

  • More than one symbol linked to class

    hey,
    how do i get more than one symbol linked to my class in my SoundClass.as file?
    thanks

    after playing around i ended up getting it after all but thanks for effort in answering ill mark as correct answer

  • Discussion eMail link causing class java.lang.NoClassDefFoundError on reply

    When forwarding an eMail link from a discussion, if the user follows the link and then clicks on "reply" it causes a  class java.lang.NoClassDefFoundError 
    This also happens if you create a favorite to the discussion. 
    Our portal is running:
       J2EE Engine 6.40 PatchLevel 100627.313
       Portal 6.0.15.0.0
       KnowledgeManagementCollaboration 6.0.15.0.0 (NW04 SPS15)
    <b>My question is what file is missing or what entry in the portalapp.xml is missing?</b>
    Here is the detail:
    System Error
    An exception occurred during the program execution. Below you will find technical information pertaining to this exception that you might want to forward to your system administrator.
    Exception Class     
    Call Stack     java.lang.ClassCastException
            at com.sapportals.wcm.control.generic.WcmErrorControl.readInputData(WcmErrorControl.java:558)
            at com.sapportals.wdf.stack.Control.triggerInput(Control.java:473)
            at com.sapportals.wdf.WdfEventDispatcher.dispatch(WdfEventDispatcher.java:172)
            at com.sapportals.wdf.WdfCompositeController.onWdfEvent(WdfCompositeController.java:538)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:324)
            at com.sapportals.htmlb.page.DynPage.doProcessCompositeEvent(DynPage.java:204)
            at com.sapportals.htmlb.page.DynPage.doProcessCurrentEvent(DynPage.java:142)
            at com.sapportals.htmlb.page.PageProcessor.handleRequest(PageProcessor.java:115)
            at com.sapportals.portal.htmlb.page.PageProcessorComponent.doContent(PageProcessorComponent.java:134)
            at com.sapportals.wcm.portal.component.base.ControllerComponent.doContent(ControllerComponent.java:73)
            at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)
            at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)
            at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
            at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
            at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
            at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:215)
            at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:646)
            at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
            at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
            at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
            at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:753)
            at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:240)
            at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:522)
            at java.security.AccessController.doPrivileged(Native Method)
            at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:405)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
            at com.sap.engine.services.servlets_jsp.server.servlet.InvokerServlet.service(InvokerServlet.java:156)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
            at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
            at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
            at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
            at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
            at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
            at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
            at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
            at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
            at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
            at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
            at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
            at java.security.AccessController.doPrivileged(Native Method)
            at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
            at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)

    Hello Joel,
    Yes, I did follow the guide in Stefan's Blog and used the correct three standalone SDA files;
    actually I found out in CE 7.1.1, these three DC already exist after standard installation and
    have not deployed them at all.
    Thank you for your input.
    Ying-Jie Chen

  • Linking of class characteristics

    Hi sap gurus,
    How to get the value of class-characteristic in results recording of inspection lot
    Cheers,
    Krishna

    Hi,
    Find the link attached for your reference.
    http://http://sap.allisontransmission.com/saphelp/helpdata/EN/2d/350a81448c11d189420000e829fbbd/content.htm[/url]
    To add spec. limits to a class characteristic:
    1. Select the characteristic
    2. Click on overwrite values icon
    3. Enter the spec.limits as 9.995 - 10.005
    4. It is worthwhile ticking the box for "Additional values", otherwise out-of-spec results will not get transferred.
    Try that and let me know if you have problems
    Note: if you need require LSL and USL to be passed to your MIC rather than a target value apply OSS note 119708 (QM: No Intervals can be derived in Configuration).
    Regards,
    Murali.S

Maybe you are looking for