AddChild function in another Class. plz help!

Hi,
I am trying to pull a funtion that adds a child to a container. This function gets pulled in another class. All the traces do work by the child doesn't show.
pulling the function from StickerBook_Class
public static var stickBook_Class:StickerBook_Class = new StickerBook_Class  ;
public var stickBook:stickerBook = new stickerBook  ;
stickBook_Class.addSticker(stickBook);
function in StickerBook_Class
public function addSticker(bg:MovieClip):void
trace("sticker in album");
stickBook.addChild(stick1)
stick1.x = 673
stick1.y = 80
any ideas what im doing wrong? the trace deos show by no image is visible.
plz help me
Thx
pavel

Hi Pavel,
isn't your method supposed to be similar to below one?
public function addSticker(sticker:MovieClip):void
     trace("sticker in album");
     stickBook.addChild(sticker);
     sticker.x = 673;
     sticker.y = 80;
it looks like you want to pass reference to movie clip in your method definition - but within method body you're using variables defined outside of method (so that is hard to other people to see what could be wrong with your code).
If you are comfortable with your IDE debugging tool just place break-point in e.g. stickBook.addChild(stick) and see what is value of *stick* object during code execution,
regards,
Peter

Similar Messages

  • Calling a function in another class that is not the App delegate nor a sngl

    Hi all-
    OK- I have searched and read and searched, however I cannot figure out an easy way to call a function in another class if that class is not the app delegate (I have that down) nor a singleton (done that also- but too much code)
    If you use the method Rick posted:
    MainView *myMainView = [[MainView alloc] init];
    [MyMainView goTell];
    That works, however myMainView is a second instance of the class MainView- I want to talk to the instance/Class already instantiated.
    Is there a way to do that without making the class a singleton?
    Thanks!

    I had some trouble wrapping my head around this stuff at first too.
    I've gotten pretty good at letting my objects communicate with one another, however I don't think my method is the most efficient or organized way but I'll try to explain the basic idea.
    When you want a class to be able to talk to another class that's initialized elsewhere, the class your making should just have a pointer in it to the class you want to communicate with. Then at some point (during your init function for example) you should set the pointer to the class you're trying to message.
    for example in the app-delegate assume you have an instance of a MainView class
    and the app-delegate also makes an instance of a class called WorkClass
    If you want WorkClass to know about MainView just give it a pointer of MainView and set it when it's instantiated.
    So WorkClass might be defined something like this
    //WorkClass.h
    @import "MainView.h"
    @interface WorkClass : NSObject
    MainView *myPointerToTheMainView;
    @property (retain) myPointerToTheMainView;
    -(void)tellMainViewHello;
    @end
    //WorkClass.m
    @import "WorkClass.h"
    @implementation WorkClass
    @synthesize myPointerToTheMainView;//this makes getter and setter functions for
    //the pointer and allows us to use the dot
    //syntax to refrence it.
    -(void)tellMainViewHello
    [myPointerToTheMainView hello]; //sends a message to the main view
    //assume the class MainView has defined a
    //method -(void)hello
    @end
    now somewhere in the app delegate you would make the WorkClass instance and pass it a reference to the MainView class so that WorkClass would be able to call it's say hello method, and have the method go where you want (to the single instance of MainView owned by the app-delegate)
    ex:
    //somewhere in app-delegate's initialization
    //assume MainView *theMainView exists and is instantiated.
    WorkClass *myWorkClass = [[WorkClass alloc] init];
    myWorkClass.myPointerToTheMainView = theMainView; //now myWorkClass can speak with
    // the main view through it's
    // reference to it
    I hope that gets the basic idea across.
    I'm pretty new to Obj-c myself so if I made any mistakes or if anyone has a better way to go about this please feel free to add
    Message was edited by: kodafox

  • Calling a function from another class - help!

    I realize that this is probably a basic thing for people who have been working with JavaFX for a while, but it is eluding me, and I have been working on it for over a week.
    I need to call a function that is in another class.  Here's the deal.  In EntryDisplayController.java, there are 2 possible passwords that can be accepted - one will give full access to the car, the second will limit functions on the car.  So when a password is entered and verified as to which one it is, I need to call a function in MainDisplayController.java to set a variable that will let the system know which password is being used - full or restricted.
    So in MainDisplayController.java I have this snippet to see
    public class MainDisplayController implements Initializable, ControlledScreen {
        ScreensController myController;
        public static char restrict;
         * Initializes the controller class.
        @Override
        public void initialize(URL url, ResourceBundle rb) {
            // TODO
        public void setRestriction(){
            restrict = 0;
            restrictLabel.setText("RESTRICTED");
        public void clearRestriction(){
            restrict = 1;
            restrictLabel.setText("");
    And in EntryScreenDisplay.java I have this snippet:
    public class EntryDisplayController implements Initializable, ControlledScreen {
         @FXML
        private Label passwordLabel ;
        static String password = new String();
        static String pwd = new String("");
         ScreensController myController;
         private MainDisplayController controller2;
         * Initializes the controller class.
        @Override
        public void initialize(URL url, ResourceBundle rb) {
            setPW(pwd);    // TODO
         @FXML
        private void goToMainDisplay(ActionEvent event){
            if(password.equals ("123456")){
              controller2.clearRestriction();
               myController.setScreen(ScreensFramework.MainDisplayID);
               pwd = "";
               password = "";
               setPW(pwd);
            else if(password.equals ("123457")){
               controller2.setRestriction();
                myController.setScreen(ScreensFramework.MainDisplayID);
               pwd = "";
               password = "";
               setPW(pwd);
            else{
                password = "";
                pwd = "";
                setPW(pwd);
    When I enter the restricted (or full) password, I get a long list of errors, ending with
    Caused by: java.lang.NullPointerException
      at velocesdisplay.EntryDisplayController.goToMainDisplay(EntryDisplayController.java:60)
    Line 60 is where "controller2.setRestriction(); is.
    As always, thanks for any help.
    Kind regards,
    David

    You never set the controller2 variable to anything, which is why you get a null pointer exception when you try to reference it.
    public static variables (and even singletons) are rarely a good idea as they introduce global state (sometimes they can be, but usually not).
    If a static recorder like this can only have a binary value, use a boolean, if it can have multiple values, use an enum.
    Some of the data sharing solutions in dependency injection - Passing Parameters JavaFX FXML - Stack Overflow might be more appropriate.
    I also created a small framework for roll based solutions in JavaFX which perhaps might be useful:
    http://stackoverflow.com/questions/19666982/is-there-a-way-to-implement-a-property-like-rendered-on-javafx
    https://gist.github.com/jewelsea/7229260
    It was just something I hacked together, so it's not a fully polished solution and you probably don't need something quite so complex.
    What you need is a model class shared between the components of your application.  Dependency injection frameworks such as afterburner.fx can help achieve this in a fairly simple to use way.
    If you don't want to go with a dependency injection framework, then you could use either a static singleton model class for your settings or pass the model class using the mechanism in defined in the passing parameters link I provided.  For a model class example, see the ClickCounter class from this example.   That example doesn't use FXML, but to put it together with the passing parameters solution, for your restriction model, you would have something like the following:
       private class Restricted {
         private final ReadOnlyBooleanWrapper restricted;
         public Restricted(boolen isRestricted) {
           restricted = new ReadOnlyBooleanWrapper(isRestricted);  
         public boolean isRestricted() {
           return restricted.get();
         public ReadOnlyBooleanProperty restrictedProperty() {
           return restricted.getReadOnlyProperty();
    Then in your EntryDisplayController you have:
    @FXML
    public void goToMainDisplay(ActionEvent event) {
         // determine the restriction model as per your original code...
         RestictionModel restrictionModel = new RestrictionModel(<appropriate value>);
      FXMLLoader loader = new FXMLLoader(
      getClass().getResource(
       "mainDisplay.fxml"
      Stage stage = new Stage(StageStyle.DECORATED);
      stage.setScene(
       new Scene(
         (Pane) loader.load()
      MainDisplayController controller =
        loader.<MainDisplayController>getController();
      controller.initRestrictionModel(restrictionModel);
      stage.show();
    class MainDisplayController() {
      @FXML private RestrictionModel restrictionModel;
      @FXML private RestrictLabel restrictLabel;
      public void initialize() {}
      // naming convention (if the restriction model should only be set once per controller, call the method init, otherwise call it set).
      public void initRestrictionModel(RestrictionModel restrictionModel) {
        this.restrictionModel = restrictionModel;
         // take some action based on the new restriction model, for example
        restrictLabel.textProperty.bind(
          restrictionModel.restrictedProperty().asString()
    If you have a centralized controller for your navigation and instantiation of your FXML (like in this small FXML navigation framework), then you can handle the setting of restrictions on new screens centrally within the framework at the point where it loads up FXML or navigates to a screen (it seems like you might already have something like this with your ScreensController class).
    If you do this kind of stuff a lot, then you would probably benefit from a move to a framework like afterburner.  If it is just a few times within your application, then perhaps something like the above outline will give you enough guidance to implement a custom solution.

  • Calling a function inside another class

    I have the following two classes and can't seem to figure to figure out how to call a function in the top one from the bottom one. The top one get instantiated on the root timeline. The bottom one gets instantiated from the top one. How do I call functions between the classes. Also, what if I had another call instantiated in top one and wanted to call a function in the bottom class from the second class?
    Thanks a lot for any help!!!
    package
         import flash.display.MovieClip;
         public class ThumbGridMain extends MovieClip
              private var grid:CreateGrid;
              public function ThumbGridMain():void
                   grid = new CreateGrid();
              public function testFunc():void
                   trace("testFunc was called");
    package
         import flash.display.MovieClip;
         public class CreateGrid extends MovieClip
              public function CreateGrid():void
                   parent.testFunc();

    kglad,
    Although I agree that utilizing events the way you attempted in your suggestion is better for at least a reason of eliminating dependency on parent, still you code doesn't not accomplish what Brian needs.
    Merely adding event listener to grid instance does nothing - there is no mechanism in the code that invokes callTGMFunction - thus event will not be dispatched. So, either callTGMFunction should be called on the instance (why use events - not direct call - in this case?), or grid instance needs to dispatch this event based on some internal logic ofCreateGrid AFTER it is instantiated - perhaps when it is either added to stage or added to display list via Event.ADDED. Without such a mechanism, how is it a superior correct way OOP?
    Also, in your code in ThumbGridMain class testFunc is missing parameter that it expects - Event.
    Am I missing something?
    I guess the code may be (it still looks more cumbersome and less elegant than direct function call):
    package
         import flash.display.MovieClip;
         import flash.events.Event;
         public class ThumbGridMain extends MovieClip
             private var grid:CreateGrid;
             public function ThumbGridMain():void
                 grid = new CreateGrid();
                 grid.addEventListener("callTGMFunction", testFunc);
                 addChild(grid);
            // to call a CreateGrid function named cgFunction()
             public function callCG(){
                 grid.cgFunction();
             public function testFunc(e:Event):void
                 trace("testFunc was called");
    package
         import flash.display.MovieClip;
         import flash.events.Event;
         import flash.events.Event;
         public class CreateGrid extends MovieClip
             public function CreateGrid():void
                 if (stage) init();
                 else addEventListener(Event.ADDED, callTGMFunction);
             // to call a TGM function
             public function callTGMFunction(e:Event = null):void
               // I forgot this one
                removeEventListener(Event.ADDED, callTGMFunction);
                this.dispatchEvent(new Event("callTGMFunction"));
            public function cgFunction(){
                 trace("cg function called");
    I think this is a case of personal preference.
    With that said, it is definitely better if instance doesn't rely on the object it is instnatiated by - so, in this case, either parent should listen to event or call a function directly.

  • How to initialize a function in another class

    Hello,
    I have one class 'run.as'
    In this class i add an movieclip to the stage with it's own
    class.
    So in the constructor of run.as i have:
    _ElevatorDoors = new ElevatorDoors (200,200);
    _ElevatorDoors .name ="liftdeuren";
    addChild(_ElevatorDoors );
    Oke, that works.. the doors appear on the stage.
    In this run.as i also have a function that will open these
    doors.
    _ElevatorDoors.OpenCloseDoors();
    This is a function in the ElevatorDoors class. In this class
    i have an motionTween.
    And when the tween is finished i want to initialize a
    function in the run.as
    I don't know how to do that. I know if you extend the run.as
    class you could use super. and then the function.
    But the ElevatorDoors class has been extended to the
    MovieClip.
    Does anyone has a suggestion how to do this?
    Thanks in advance.

    I have 3 classes:
    run.as (main class)
    elevatorDoors.as (extends MovieClip)
    elevator.as (extends MovieClip)
    In the run.as i added the 2 classes (elevatorDoors.as and
    elevator) with addChild..
    From the run.as i can call functions from these classes.
    But when i want to call a function from the elevatorDoors.as
    to it's main class it works.
    And in the mainclass (run.as) i call a function in the
    elevator.as class.
    Altough i can call the function trough the mainclass i can't
    set the properties of the elevator.as movieclip.
    I don't know how to set it's properties.

  • During Foreach read another foreach - PLZ HELP!

    Hi all powershell gurus out there.
    I have a foreach which opens a URL from URLListl.txt and doing a
    Measure-command on them. The result from Measure-command writes to event-log. 
    In another text file i have country list, like:
    USA
    Canada
    Brazil
    and so on....
    I want in write eventlogs Message to read from this Text file and write it with the Measure-command result in Message part of the eventlog.
    The below is my script which works fine but it creates two entries for each URL.
    function Measure-Site
    $URLListFile = "C:\yourname\URLList.txt"
    $URLList = Get-Content $URLListFile -ErrorAction SilentlyContinue
    Foreach ($Uri in $URLList)
    $Time = Measure-Command {
    C:\yourname\MainScript.ps1}
    $Time.TotalSeconds
    $countrycode = (Get-Content c:\yourname\URLListcountry.txt)
    foreach ($SiteCode in $CountryCode)
    $LogFileExist = Get-EventLog -list | Where-Object { $_.LogDisplayName -eq "Scriptcheck" }
    if (! $LogFileExist)
    New-EventLog -LogName "Scriptcheck" -Source "Scripts"
    if ($Time.Totalseconds -lt 25)
    Write-EventLog -LogName "Scriptcheck" -Source "Scripts" -EntryType information -EventId 100 -Message " $SiteCode `nTotal Time: $Time"
    elseif ($Time.Totalseconds -gt 25)
    Write-EventLog -LogName "Scriptcheck" -Source "Scripts" -EntryType warning -EventId 101 -Message " $SiteCode `nTotal Time: $Time"
    if (Get-Process -name iexplore -ErrorAction SilentlyContinue)
    Stop-Process -Name iexplore
    Measure-Site

    Hi Arash,
    I’m writing to just check in to see if the suggestions were helpful. If you need further help, please feel free to reply this post directly so we will be notified to follow it up.
    If you have any feedback on our support, please click here.
    Best Regards,
    Anna Wang
    TechNet Community Support

  • Error in Dev Class - Plz help

    Hi Gurus
    Can anyone tell me why am getting this error meaage while transporting Business Content Sales Query.
    "Error in development class, object ELEM 2BFTY8LWFAIM6KOWLONOC7WYO not saved to the order"
    Shreya

    Shreya,
    BW objects should be transported in the following order: 
    -R/3 objects must be transported in a CTS before BW transports can begin.
    -Objects needs to be transported as per their dependencies.
    Also use the Transport Connection Tool to analyze your objects.
    Hope this helps.
    G.

  • Get CPU Serial No. in a java class,Plz Help !

    I need a class for retrieving cpu serial No.
    Any resource , any guide ?
    Thanks.

    The only way to get that information thru java is using JNI. Period. And depending on the maker of the CPU, each way of deriving this information would be different. Also, we know some CPU's let you turn that on and off so, it won't always reutrn a value even if supported.
    If your reason for using this ID is for some sort of machine identification, I wuold suggest using some combination of detecting local machine attributes and perhaps finding a way to log the unique GUID of each machine (assuming this is windows you are developing for)....then using this information to generate what you need.

  • 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

  • How to pass the object of one class to the another class?

    Hello All,
    My problem is i am sending the object of serializable class from one class to another class but when i collection this class into another it is transfering null to that side even i filled that object into the class before transfer and the point is class is serializable
    code is below like
    one class contain the code where i collecting the object by calling this function of another class:-
    class
    lastindex and initIndex is starting and ending range
    SentenceStatusImpl tempSS[] = new SentenceStatusImpl[lastIndex-initIndex ];
    tempSS[i++] = engineLocal.CallParser(SS[initIndex],g_strUserName,g_strlanguage,g_strDomain);
    another class containg code where we transfering the object:-
    class
    public SentenceStatusImpl CallParser(SentenceStatusImpl senStatus, String strUserName, String strLanguage, String strDomain)
    *//here some code in try block*
    finally
    System.+out+.println("inside finally...........block......"+strfinaloutput.length);
    senStatus.setOutputSen(strfinaloutput);//strfinaloutput is stringbuffer array containg sentence
    fillSynonymMap(senStatus);
    senStatus.setTranslateStatus(*true*);
    return senStatus;
    Class of which object is serialized name sentenceStatusimpl class:-
    public class SentenceStatusImpl implements Serializable
    ///Added by pavan on 10/06/2008
    int strSourceSenNo;
    String strSourceSen = new String();
    String strTargetSen = new String();
    StringBuffer[] stroutputSen = null;
    HashMap senHashMap = new HashMap();
    HashMap dfaMarkedMap = new HashMap();
    boolean bTargetStatus = false;
    public SentenceStatusImpl(){
    public void setOutputSen(StringBuffer[] outputSen){
    stroutputSen = outputSen;
    public StringBuffer[] getOutputSen(){
    return stroutputSen;
    public void setTranslateStatus(*boolean* TargetStatus){
    bTargetStatus = TargetStatus;
    }//class

    ok,
    in class one
    we are calling one function (name callParser(object of sentenceStatusImpl class,.....argument.) it return object of sentenceStatusImple class containg some extra information ) and we collecting that object into same type of object.
    and that sentenceStatusImple classs implements by Serializable
    so it some cases it is returning null
    if you think it is not proper serialization is please replay me and suggest proper serialization so that my work is to be done properly (without NULL)
    hope you understand my problem

  • Function group issue in upgrade plz help very urgent

    hi gurus,
    plz help me
    in a big trouble.
    deadline is today.
    when i activated the function group i found this error in an include
    LSVARCLS
    and when i clicked to this field it took me to another include
    LSVARTOP
    here i found
    data: f4_params type onf4_event_parameters_type.
    FYI:
    types: begin of onf4_event_parameters_type.
    types: c_fieldname     type lvc_fname.
    types: cs_row_no       type lvc_s_roid.
    types: cr_event_data   type ref to cl_alv_event_data.
    types: ct_bad_cells    type lvc_t_modi.
    types: c_display       type char01.
    types: end of onf4_event_parameters_type.
    data: f4_params type onf4_event_parameters_type.
    error is :
    Field "F4_PARAMS-C_FIELDNAME" is unknown. It is neither in one of the          
    specified tables nor defined by a "DATA" statement . . . . . . . . . .          
    thanks in  advance

    FUNCTION-POOL ZVAR MESSAGE-ID DB.
    TABLES:
            TADIR,                         " Entwicklungsklasse
            TRDIR,                         " Reportcatalog
            LDBD,                          " logical databases
            VARID,                         " variant properties
            RSVAVA,                        " Variable data in
                                           "  variants( sy-datum)
            RSVAR,                         " new RALDB structure
            RSVARDESC,                     " Report, Variante, Dynnr
            VARIT,                         " variants texts
            VARIS,                         " screennr per variant
            DD23T,                         "
            DFIES,                         "DD-Schnittstelle, get_field
            TPARAT,                        "Texte zu Memory-Ids
            TVARUVN, "#EC NEEDED
            SSCRFIELDS,
            t000.
    DATA  CHOOSE like sy-ucomm value 'PICK'.
    DATA  G_STATUS like sy-pfkey.
    *Includes für Icons
    INCLUDE .
    Include für Symbole
    INCLUDE .
    *Equates für SSCR
    INCLUDE RSDBCOM2.
    *Typen für dynamische Selektionen, verwendet bei RS_REFRESH_...DYNAMICAL
    TYPE-POOLS: RSDS, SYLDB, sydb0.
    data:  GS_TOOLBAR           TYPE STB_BUTTON.
    include lsvarcls.
    Key um unnoetige Datenbankzugriffe zu vermeiden
    DATA: BEGIN OF CHECK_KEY,
          REPORT  LIKE RSVAR-REPORT,
          VARIANT LIKE RSVAR-VARIANT.
    DATA: END OF CHECK_KEY.
    key für get_description
    *DATA: old_key LIKE check_key.
    CATALOG OF VARIANTS, OLD STRUCTURE. WILL BE DELETED BY FIRST
    CALL OF VARIANTS OUT OF FUNCTIONPOOL SVAR.
    INFORMATION WILL BE TRANSFERED TO VARID AND VARIT.
    DATA: VARCAT LIKE RSVARC OCCURS 20 WITH HEADER LINE.
    TEXT (=> VARIT)
    DATA: VARCATT LIKE RVART OCCURS 20 WITH HEADER LINE.
    SAVE INFORMATION ABOUT VARIANTS
    DATA: BEGIN OF SAVEINFO OCCURS 20,
             NAME      LIKE RVARI-NAME,
             NUMB      LIKE RVARI-NUMB,
             PROTECTED LIKE RVARI-PROTECTED,
             FIELDTEXT LIKE RSVAR-FIELDTEXT,
             KIND      LIKE RVARI-KIND,
             TYPE      LIKE RVARI-TYPE,
             VTYPE     LIKE RVARI-VTYPE,
             VNAME     LIKE RVARI-VNAME,
           appendage I= Matchcode, C=Checkbox etc
             APPENDAGE LIKE RSVAR-INVISIBLE,
             VARIS(1),                     " TVARV, FUBAU
           N= Ausgeblendet von Report,X ausgeblendet in Variante
             INVISIBLE,
             USER,
             MEMORYID LIKE RSSCR-SPAGPA,
           nur auf einem Bild vorhanden
             GLOBAL,
             NO_IMPORT,
             SPAGPA,
             NOINTERVALS,
             OBLIGATORY LIKE RSVAR-OBLIGATORY,
             RADIO,
         END OF SAVEINFO.
    DATA: BEGIN OF SAVEINFO_DYN OCCURS 10,
            TABLENAME LIKE RSDSTABS-PRIM_TAB,
            FIELDNAME LIKE RSDSTABS-PRIM_FNAME,
            FIELDTEXT LIKE RSVAR-FIELDTEXT,
            TYPE      LIKE RVARI-TYPE,
            VTYPE     LIKE RVARI-VTYPE,
            VNAME     LIKE RVARI-VNAME,
            VARIS(1),
            PROTECTED LIKE RVARI-PROTECTED,
            GLOBAL(1).
    DATA: END   OF SAVEINFO_DYN.
    data: saveinfo_sav like saveinfo occurs 0 with header line.
    data: saveinfo_dyn_sav like saveinfo_dyn occurs 0 with header line.
    key for import of variants from VARI
    DATA: BEGIN OF $RKEY,
            REPORT  LIKE RSVAR-REPORT,
            VARIANT LIKE RSVAR-VARIANT,
          END OF   $RKEY.
    vari
    DATA: L_VARI LIKE RVARI OCCURS 20 WITH HEADER LINE.
    %_SSCR
    DATA SELCTAB LIKE RSSCR OCCURS 20 WITH HEADER LINE.
    DATA GLOB_SUBMODE(2).
    DATA LOC_SUBMODE(2).
    screenfields
    DATA: XCODE(4).
    DATA: FCODE(4)      TYPE C,
          FUNC(4)       TYPE C.
    DATA: BEGIN OF INFO OCCURS 20,
            FLAG,
            OLENGTH TYPE X,
            LINE  LIKE RSVAR-INFOLINE,
          END OF INFO.
    DATA: VALUTAB LIKE RSPARAMSL OCCURS 40 WITH HEADER LINE.
    Zur allgemeinen Verwendung
    FIELD-SYMBOLS: .
    DATA ILLEGAL_CHAR.                     " Wrong sign in variant
    copy
    DATA: VARIANT2 LIKE RSVAR-VARIANT,
          VARIANT1 LIKE RSVAR-VARIANT.
    *list of parameters and select-options, screenobjects
    DATA: L_SELOP LIKE VANZ OCCURS 20 WITH HEADER LINE.
    DATA: L_SELOP_NONV LIKE VANZ OCCURS 20 WITH HEADER LINE."nonv = non visi
    DATA: L_PARAMS LIKE VANZ OCCURS 20 WITH HEADER LINE.
    DATA: L_PARAMS_NONV LIKE VANZ OCCURS 20 WITH HEADER LINE.
    DATA: SCREENOBJECTS LIKE VANZ OCCURS 20 WITH HEADER LINE.
    list of all variants concerning one report
    DATA: BEGIN OF VARI_LIST OCCURS 40,
                MARKFIELD LIKE RSVAR-MARKFIELD,
                VARIANT   LIKE RSVAR-VARIANT,
                TEXT      LIKE RVART-VTEXT,
                ENAME     LIKE RSVARC-ENAME,
                AENAME    LIKE RSVARC-AENAME,
                PROTECTED LIKE RSVARC-PROTECTED,
                ENVIRONMT LIKE RSVARC-ENVIRONMT,
                XFLAG1    LIKE VARID-XFLAG1.
    DATA: END OF VARI_LIST.
    *Variablen für das Blättern auf den Dynpros 1303 und 306.
    DATA: VARI_LIST_SCROLL LIKE SY-STEPL VALUE '1'.
    DATA: SAVE_OKCODE(4).
    table for  Dynpro 306 (delete variants)
    DATA: BEGIN OF H_VARILIST OCCURS 30,
                MARKFIELD LIKE RSVAR-MARKFIELD,
                FLAG1     LIKE RSVAR-FLAG1,
                FLAG2     LIKE RSVAR-FLAG2,
                FLAG3     LIKE RSVAR-FLAG3,
                VARIANT LIKE RSVAR-VARIANT.
    DATA: END OF H_VARILIST.
    CONSTANTS: C_PDLIST_WIDTH TYPE I VALUE '24',
               C_VARILIST     TYPE I VALUE '10'.
    DATA: CATTOP LIKE SY-TABIX VALUE '3'.  "lines top-of-page in CATALOG.
    *data: listtop like sy-tabix value '3'.  "lines top-of-page in Delete
    "vari
    DATA: PRINT_ALL_VAR.                   "alle Varianten drucken
    DATA: PRINT_CAT_VAR.                   "Katalog drucken
    Systemumgebung
    DATA ENVIRONMENT.                      " S: SAP, C: Customer
    Dynpro 320
    DATA : TEXT0(59).
    *Tables and fields for fitting variants
    *table of variants which must be fitted
    DATA: BEGIN OF FIT_VAR OCCURS 50,
           VARIANT LIKE RSVAR-VARIANT,
           FLAG(1).                        " flag = 'X' => Variante can't be
    DATA: END OF FIT_VAR.                  "fitted.
    DATA: BEGIN OF SINGLE_OPTIONS OCCURS 8,
           OPTION(2),
            TEXT(18).
    DATA: END OF SINGLE_OPTIONS.
    variants which contain variables
    internal table, per line  select-options and parameters which
    use variables
    DATA: BEGIN OF VARIVAR OCCURS 20,
            SELNAME     LIKE RSSCR-NAME,
            SELTEXT     LIKE RSVAR-FIELDTEXT,
            KIND        LIKE RVARI-KIND,
            TYPE        LIKE RVARI-TYPE,
            VTYPE       LIKE RSVAR-VTYPE,
            VTEXT       LIKE RSVAVA-VTEXT,
            FB,
            TVARV,
            VNAME       LIKE RSVAR-VNAME,
            OPTION      LIKE RSVAR-OPTION,
            SIGN(1),
            INFO_TABIX  LIKE SY-TABIX,
            DATES_TABIX LIKE SY-TABIX,
            USER,
            MEMORYID LIKE TPARA-PARAMID,
         END   OF VARIVAR.
    DATA: BEGIN OF VARIVAR_DYN OCCURS 20,
            TABLENAME  LIKE RSDSTABS-PRIM_TAB,
            FIELDNAME   LIKE RSDSTABS-PRIM_FNAME,
            KIND        LIKE RVARI-KIND,
            TYPE        LIKE RVARI-TYPE,
            VTYPE       LIKE RSVAR-VTYPE,
            VTEXT       LIKE RSVAVA-VTEXT,
            FB,
            TVARV,
            VNAME       LIKE RSVAR-VNAME,
            OPTION      LIKE RSVAR-OPTION,
            SIGN(1),
            INFO_TABIX  LIKE SY-TABIX,
            DATES_TABIX LIKE SY-TABIX,
         END   OF VARIVAR_DYN.
    DATA: VARIDATE_S LIKE RSVARIVAR OCCURS 20 WITH HEADER LINE.
    Tabelle der möglichen Datumsberechnungen für Variablen in Varianten
    Parameter
    DATA: VARIDATE_P LIKE RSVARIVAR OCCURS 20 WITH HEADER LINE.
    table of possible TVARV-variables (parameters)
    DATA: TVARV_P LIKE TVARV OCCURS 20 WITH HEADER LINE.
    table of possible TVARV-variables (select-options)
    DATA: TVARV_S LIKE TVARV OCCURS 20 WITH HEADER LINE.
    description of fields  VARIDATES
    DATA: FIDESC_DATES LIKE RSVBFIDESC OCCURS 5 WITH HEADER LINE.
    description of fields TVARV
    DATA: FIDESC_TVARV LIKE RSVBFIDESC OCCURS 5 WITH HEADER LINE.
    description of fields OPTION
    DATA: FIDESC_OPTION LIKE RSVBFIDESC OCCURS 5 WITH HEADER LINE.
    description of fields OPTION
    Feldtabelle für DYNP_VALUES_READ/UPDATE
    DATA DYNPFIELDS LIKE DYNPREAD OCCURS 50 WITH HEADER LINE.
    *desctab
    DATA: DESCTAB LIKE RSBREPI OCCURS 20 WITH HEADER LINE.
    *Hilfsfelder für Übergabeparameter
    DATA:G_SUBRC LIKE SY-SUBRC,
         L_RC LIKE SY-SUBRC.
    *Hilfsfelder für Sperren
    DATA: G_ENQSUB LIKE SY-SUBRC.
    *Hilfsfeld für mandantenabhängiges Löschen von Varianten
    DATA: DEL_ALL_VAR. "=X alle Mandanten, =' ' nur aktueller Mandant
    select variant form list.
    DATA: BEGIN OF VARIANT_TABLE OCCURS 30,
          VARIANT LIKE RSVAR-VARIANT,
          TEXT LIKE VARIT-VTEXT,
          ENVIR LIKE VARID-ENVIRONMNT,
          ENAME LIKE VARID-ENAME,
          AENAME LIKE VARID-AENAME,
          aedat like varid-aedat,
          MLANGU LIKE VARID-MLANGU,
          protected like varid-protected,
          SELSCREEN(80).                  "<= 20 Bilder
    DATA: END OF VARIANT_TABLE.
    DATA: CALL_FLAG.                             "screen 305.
    DATA: MODE_FLAG.
    Print variants  screen 308
    DATA: PRINT_LIST LIKE RSREPVAR OCCURS 30 WITH HEADER LINE.
    parameters in variables
    DATA: BEGIN OF VARIVDAT  OCCURS 5,
                SELNAME LIKE RVARI-NAME.
                INCLUDE STRUCTURE RSINTRANGE.
    DATA: END OF VARIVDAT.
    DATA: VARIVDAT_WORK LIKE VARIVDAT OCCURS 10 WITH HEADER LINE.
    DATA:EXC_SUBC LIKE SY-SUBRC.
    DATA: BEGIN OF LDB_VARIVAR OCCURS 10,
                   MARKFIELD LIKE RSVAR-MARKFIELD,
                   VTEXT     LIKE RSVARIVAR-TEXT,
                   VTYPE     LIKE RSVAR-VTYPE.
    DATA: END OF LDB_VARIVAR.
    *generate subroutinepool
    DATA: BEGIN OF REPDAT_TAB OCCURS 40,
             LINE(72),
          END OF REPDAT_TAB.
    *Tabelle zur Übergabe der alten Selektionswerte wenn sich
    *Parameter oder Select-Options geändert haben.
    *Wird von rs_variant_obsolet benötigt.
    DATA: OLD_SELECTIONS LIKE RSPARAMSL OCCURS 20 WITH HEADER LINE.
    *Flag für Aufruf aus QUERY und Report-Writer.
    *Reportname auf Einstiegsbild nicht sichtbar (not_visible = x)
    DATA: NOT_VISIBLE.
    *Varianten für Query
    DATA: QUERY_SYSVAR.
    *Einstiegsbild mit anderem Titel aufrufen.
    DATA: N_TITLE(40).
    *F4 Hilfe RS_VARIANT_CATALOG mit anderem Titel aufrufen
    DATA: G_TITLE like sy-title.
    *Unterscheidung auf Listdynpro (hauptsächlich 307)
    DATA: CALLER(4).
    *sy-subrc Felder für Import und Export.
    DATA: EXP_SUBRC LIKE SY-SUBRC,
          IMP_SUBRC LIKE SY-SUBRC.
    *Tabellen für dynamische Selektionen
    DATA: DYNSEL_DESC LIKE RSDYNBREPI OCCURS 5 WITH HEADER LINE.
    DATA: DYNS_FIELDS LIKE RSDSFIELDS OCCURS 5 WITH HEADER LINE.
    DATA: DYNSEL_VALUE LIKE RSSELDYN OCCURS 5 WITH HEADER LINE.
    *tabellen für matchcodeselection
    DATA: BEGIN OF MC_DESC OCCURS 5,
                 NAME    LIKE RSSCR-NAME,
                 ID      LIKE MCPARAMS-MCID,
                 OBJECT(10),
                 S_STRING LIKE MCPARAMS-STRING,
                 D_TEXT   LIKE DD23T-MCTEXT,
                 FROM     LIKE VANZ-FROM,
                 TO       LIKE VANZ-TO.
    DATA: END   OF MC_DESC.
    *Tabelle für Umsetzung dynamische Selektionen
    *flag = space -> umgesetzt
    *flag = G     -> Variante z.Z gesperrt
    *flag = I     -> Fehler beim Import
    DATA: BEGIN OF CHANGED_VARIANTS OCCURS 10,
                   NAME LIKE RSVAR-VARIANT,
                   FLAG.
    DATA: END OF CHANGED_VARIANTS.
    *Feld für Ikonen auf Dynpros.
    DATA: IKON(8).
    *Konstanten für Ikonen
    CONSTANTS: POP_WARNING(8) VALUE '@1A@',
               POP_ERROR(8) VALUE '@1B@',
               POP_INFO(8) VALUE '@19@',
               POP_COPY(8) VALUE '@14@',
              c_icon_enter_more(15) value 'ICON_ENTER_MORE',
               C_ICON_DISPLAY_MORE(17) VALUE 'ICON_DISPLAY_MORE'.
    DATA: MORE_ICON LIKE RSSELINT-OPTI_PUSH.
    *Konstanten für Variante ändern, Werte oder Attribute
    CONSTANTS: C_VAL  VALUE 'V'.
    Interne Tabelle für Transport
    DATA: BEGIN OF REP_VAR OCCURS 10,
            MARKFIELD.
            INCLUDE STRUCTURE $RKEY.
    DATA: END   OF REP_VAR.
    DATA: REP_VAR_CURSOR LIKE SY-INDEX VALUE 0.
    Tabelle für RS_SELOPT_INFO -> BBS
    DATA: DEFAULTS LIKE RSPARAMSL OCCURS 10 WITH HEADER LINE.
    Tabelle für Werteanzeige Tvarv.
    DATA: TVARVTAB LIKE TVARV OCCURS 10 WITH HEADER LINE.
    SUBTY-Equates
    INCLUDE RSDBCSTY.
    Textfeld für Dynpro 317.
    DATA: TEXT(4).
    Konstante für Namenskonvention Systemvariante
    CONSTANTS: SYS_VNAME(4) VALUE 'SAP&'.
    CONSTANTS: CUS_VNAME(4) VALUE 'CUS&'.
    Flag für Systemvariante gewünscht.
    DATA: C_SYSVAR.
    data vari_mandt like sy-mandt.
    data sysvar_mandt like sy-mandt value '000'.
    Check für Systemvariante
    DATA: SYSVAR_FLAG.
    Flag für Entwicklungsklasse , Werte Y oder N (aus get_devcalss)
    DATA: NON_LOCAL VALUE 'Y'.
    DATA: TABIX LIKE SY-TABIX.
    *Strutur für freie Abgrenzungen.
    DATA: VARIDYN LIKE RSVARIDYN OCCURS 10 WITH HEADER LINE.
    DATA: VDATDYN LIKE RSVDATDYN OCCURS 10 WITH HEADER LINE.
    DATA: VARIVDAT_DYN LIKE RSVDATDYN OCCURS 10 WITH HEADER LINE.
    DATA: BEGIN OF VARIVDAT_DYN_WORK OCCURS 10,
             TABLENAME LIKE RSVARIDYN-TABLENAME,
             FIELDNAME LIKE RSVARIDYN-FIELDNAME.
             INCLUDE STRUCTURE RSINTRANGE.
    DATA: END OF VARIVDAT_DYN_WORK.
    CONSTANTS: NO_IMPORT VALUE SPACE.
    Teilt IM/EXPORT_VARIANT_STATIC mit, welche übergebeneb Objekte
    im/exportiert werden sollen.
      DATA: BEGIN OF IMEX,
              VARI,
              DYNS,
            END   OF IMEX.
    Tabelle für Selektionsbildnummern
    DATA: DYNNR LIKE RSDYNNR OCCURS 10 WITH HEADER LINE.
    DATA: BEGIN OF CHOOSE_DYNNR OCCURS 10,
            MARKFIELD.
            INCLUDE STRUCTURE RSDYNNR.
    DATA: END OF CHOOSE_DYNNR.
    Sichern vom Selektionsbild, RSVAR_VARIANTT zurücksetzen
    DATA: FLAG_FIRST.     "#EC NEEDED
    DATA: FLAG_PROTECTED. "#EC NEEDED
    Daten für CALL SELECTION SCREEN Varianten
    DATA: HIDE_FLAG.
    DATA: LINE_NUMBER LIKE SY-TABIX.
    DATA: VARISCREENS LIKE RSDYNNR OCCURS 10 WITH HEADER LINE.
    data: variscreens_sav like rsdynnr occurs 10 with header line.
    DATA: FLAG_1000.
    DATA: DYNNR_TFILL LIKE SY-TFILL.
    DATA: VARISCREENS_TFILL LIKE SY-TFILL.
    DATA: DMORE_ICON(40).
    DATA: BEGIN OF  GLOBAL_OBJECTS OCCURS 10,
              NAME LIKE RSSCR-NAME,
          END   OF  GLOBAL_OBJECTS.
    DATA: BEGIN OF DYN_TAB OCCURS 10,
                DBFIELD LIKE RSSCR-DBFIELD,
          END   OF DYN_TAB.
    CONSTANTS: C_P_COLUMN TYPE I VALUE 38,
               C_I_COLUMN TYPE I VALUE 41,
               C_N_COLUMN TYPE I VALUE 44,
               C_S_COLUMN TYPE I VALUE 47,
               C_W_COLUMN TYPE I VALUE 50,
               C_M_COLUMN TYPE I VALUE 53,
               C_O_COLUMN TYPE I VALUE 56,
               MAX_WIDTH_ATTR TYPE I VALUE 77.
    CONSTANTS: MAX_WIDTH_SELVAR TYPE I VALUE 57.
    DATA: FLAG_NOIMPORT.
    DATA: CURR_STATUS(4).
    DATA: SCREEN_TITLES LIKE RSSCRITLE OCCURS 10 WITH HEADER LINE.
    RANGES V_RANGE FOR VARID-VARIANT OCCURS 10.
    DATA: FLAG_ALL_SCREENS.
    CONSTANTS: C_LOW TYPE I VALUE 34,
               C_HIGH TYPE I VALUE 58,
               C_TO   TYPE I VALUE 54,
               C_OUTPUT_LENGTH TYPE I VALUE 26,
               C_DISPLAY_LENGTH TYPE I VALUE 87,
               C_DISPLAY_LENGTH_ATTR TYPE I VALUE 104,
               C_DISPLAY_LENGTH_CAT  TYPE I VALUE 118,
               C_NO VALUE '0',
               C_DYNNR LIKE SCREEN-NAME VALUE 'RSVAR-DYNNR',
               C_ICON_MORE LIKE SCREEN-NAME VALUE 'DMORE_ICON',
               C_SCREEN_1000 LIKE SY-DYNNR VALUE '1000'.
    DATA: BELONGING_DYNNR LIKE RSDYNNR OCCURS 10 WITH HEADER LINE.
    DATA: PREFIX(20).
    DATA: D_320_TEXT(35).
    DATA: OLD_VARI LIKE RSVAR-VARIANT.
    DATA: L_SUBMODE LIKE GLOB_SUBMODE.
    DATA: ICON_1(40), ICON_2(40), ICON_3(40).
    DATA: FLAG_ICON_1, FLAG_ICON_2, FLAG_ICON_3.
    DATA: FLAG_CALLED_FROM_SELSCREEN.
    DATA: VARIVAR_TEXT LIKE RSVAVA-VTEXT.
    DATA: VARIVAR_KIND LIKE RSSCR-KIND.
    DATA: LIST_LINE LIKE SY-LILLI.
    DATA: MOD_LINE LIKE SY-LILLI.
    DATA: G_SP TYPE SYLDB_SP.
    DATA: G_RANGE TYPE RSDS_RANGE,
          G_FRANGE TYPE RSDS_FRANGE,
          G_RSDSSELOPT LIKE RSDSSELOPT.
    DATA: G_ILL_CHAR.
    DATA: FLAG_CHANGE_VARIANT.
    DATA: EXIT_FLAG.
    DATA: COMP_NODI_NAME LIKE RSSCR-NAME.
    DATA: EXCLUDE LIKE RSEXFCODE OCCURS 0 WITH HEADER LINE.
    hidefelder für Attributebild.
    DATA: HIDE(10).
    Feldbeschreibung aufgeklappt oder zugeklappt
    DATA: STATE(4).
    DATA: NO_DISPLAY_VISIBLE TYPE BOOLEAN VALUE 'F'.
    DATA: READ_LINE LIKE SY-INDEX.
    CONSTANTS: C_COLLAPSE(4) VALUE 'COLL',
               C_EXPAND(4)   VALUE 'EXPA',
               C_TRUE VALUE 'T',
               C_FALSE VALUE 'F'.
    CONSTANTS: CAT_LINE_SIZE TYPE I VALUE '127'.
    DATA: G_EXPOREP TYPE SY-REPID.
    DATA: SUBSCREENPROG LIKE SY-REPID,
          SUBSCREENDYNNR LIKE SY-DYNNR.
    data: g_subc like trdir-subc.
    data: status_for_subscreens.
    Data for subscreen processing
    data: begin of g_subscreen,
            ucomm type syucomm,
            submode(2),
            total type i,
            current type i,
            exclude type rsexfcode occurs 0,
            rkey type rsvarkey,
            variscreens type rsdynnr occurs 0,
            sscr type rsscr occurs 0,
         end   of g_subscreen.
    INCLUDE SVARSELO.
    Daten für ALV-GRID
    data:
    GT_TOOLBAR_EXCLUDING TYPE UI_FUNCTIONS,
    GRID1                TYPE REF TO CL_GUI_ALV_GRID,
    GRID2                TYPE REF TO CL_GUI_ALV_GRID,
    alv_fieldcat         TYPE LVC_T_FCAT WITH HEADER LINE,
    EVENT_RECEIVER1      TYPE REF TO CL_EVENT_RECEIVEr1,
    selected             value 'X',
    alv_layout           TYPE LVC_S_LAYO,
    alv_STABLE type LVC_S_STBL,
    ROW_TABLE            TYPE LVC_T_ROW        WITH HEADER LINE,
    alv_container_1      type REF TO CL_GUI_CUSTOM_CONTAINER,
    alv_container_2      type REF TO CL_GUI_CUSTOM_CONTAINER.
    constants: c_search value 'S'.

  • Plz help load class files

    hai forum,
    Plz help me out regarding this trouble.
    I have extracted class files of a jar file into a local directory D:\myClass.
    Now i need to access these class files.I loaded the path D:\myClass using URL ClassLoader.
                                  File file = new File("D:myClass");               
                          URL url = file.toURL();         
                          URL[] urls = new URL[]{url};
                          ClassLoader cl = new URLClassLoader(urls);
                          Class c = cl.loadClass(classname);The rest of the code is for listing the methods of the class file.But the class file is not getting loaded and thus the methods are not listed.
    Has it got anything to do with the way i have extracted and stored the class files?
    Plz help me identify my mistake.
    Thank you.

    Hi, I will borrow this thread to discuss my problem with loading a class file.
    How do you use the class when you have loaded it?
    I'm using this code:
    File file = new File("C:\\Foo\\Foo.class");
    URL url = file.toURL();
    URL[] urls = new URL[]url;
    ClassLoader cl = new URLClassLoader(urls);
    Class c = cl.loadClass(cl.getClass().getName());
    Object o = c.newInstance(); <-- This can't be done, my applet just stops and starts to wait or something. I don't get any exception or anything.
    The class Foo.class has a constructor that's prints some text and a function that can print some other text. Is it possible to call that function in some way?

  • How can  I access my java class file in a .jar file ...PLz Help anyone!!

    Hi Folks,
    I am new in Java programming, have a .jar file that contains .java files that I want no access and use from another .java file. These files in the .jar file basically form a library thus have no main-method. However I can not declare an instance of the library (in the .jar file) and use it within my program.
    Plz help ...I have tried all I know in vain.
    Thanks.

    temba wrote:
    Hi Folks,
    I am new in Java programming, have a .jar file that contains .java files that I want no access and use from another .java file. These files in the .jar file basically form a library thus have no main-method. However I can not declare an instance of the library (in the .jar file) and use it within my program. You are making little sense. You can't instantiate .java files.
    Plz help ...I have tried all I know in vain.
    Thanks.Could you post WHAT you have tried and also post what error messages you received?

  • How to call another class function in SharePoint?

    Facing 'ConvertViewToHtml' does not exit in current context. Here is my code:
    namespace ChangeControl3_Nov
    class eGA_Utility
    public static void SendmailwithTwo(string To, string subject, string Body, string frommail, byte[] docFile, byte[] docFile1, string fileName1, string fileName3)
    string smtpServer = SPAdministrationWebApplication.Local.OutboundMailServiceInstance.Server.Address;
    string smtpFrom = SPAdministrationWebApplication.Local.OutboundMailSenderAddress;
    string smtpReplyTo = SPAdministrationWebApplication.Local.OutboundMailReplyToAddress;
    MailMessage mailMessage = new MailMessage();
    System.Net.Mail.MailAddress from = new System.Net.Mail.MailAddress(frommail, "Quality Management");
    mailMessage.From = from;
    mailMessage.To.Add(new MailAddress(To));
    mailMessage.Subject = subject;
    mailMessage.IsBodyHtml = true;
    mailMessage.Priority = MailPriority.High;
    mailMessage.Body = ConvertViewToHtml();
    MemoryStream stream = new MemoryStream(docFile);
    string fileName2 = fileName1;
    Attachment attachment = new Attachment(stream, fileName2);
    mailMessage.Attachments.Add(attachment);
    MemoryStream stream1 = new MemoryStream(docFile1);
    string fileName4 = fileName3;
    Attachment attachment1 = new Attachment(stream1, fileName4);
    mailMessage.Attachments.Add(attachment1);
    SmtpClient smtpClient = new SmtpClient(smtpServer);
    NetworkCredential oCredential = new NetworkCredential("", "");
    try
    smtpClient.UseDefaultCredentials = false;
    smtpClient.Credentials = oCredential;
    smtpClient.Send(mailMessage);
    catch (Exception)
    I would like to call "ConvertViewToHtml()" from FormCode.cs in this line: 
    mailMessage.Body = ConvertViewToHtml();
    namespace ChangeControl3_Nov
    public partial class FormCode
    public string ConvertViewToHtml()
    try
    byte[] sourceFile = null;
    XPathNavigator root = MainDataSource.CreateNavigator();
    string myViewName = this.CurrentView.ViewInfo.Name.Replace(" ", string.Empty);
    string myViewXslFile = myViewName + ".xsl";
    // Create the xsl transformer
    XslCompiledTransform transform = new XslCompiledTransform();
    transform.Load(ExtractFromPackage(myViewXslFile));
    // Generate a temporary HTML file
    string fileName = Guid.NewGuid().ToString() + ".htm";
    string filePath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), fileName);
    using (XmlWriter writer = XmlWriter.Create(filePath))
    // Convert the XML to HTML
    transform.Transform(root, writer);
    writer.Close();
    // Return the HTML as a string
    sourceFile = File.ReadAllBytes(filePath);
    return System.Text.Encoding.UTF8.GetString(sourceFile);
    catch (Exception ex)
    return "<html><body>Unable to convert the view to HTML <p>" + ex.Message + "</p></body></html>";
    How to do this? Thanks in advance!

    Hi Sam,
    According to your description, you might want to call a function from other class.
    Before calling this function, it will require to initialize a FormCode object and then we can call the functions of the FormCode class.
    You can take a look at the code snippet provided by tompsonn in this similar thread:
    http://www.overclock.net/t/1411342/calling-a-function-from-another-form-c
    More information about working with Partial Classes and Methods:
    http://msdn.microsoft.com/en-us/library/wa80x488.aspx
    Thanks 

  • My Macbook pro,s Airdrop isn't functional  plz help me to use it

    Hi everybody.
    My Macbook pro,s  Airdrop  isn't  functional  plz help me to use it.

    Mac Basics: AirDrop helps you share items with others nearby

Maybe you are looking for

  • Should I backup my hard drive before I do a disk repair in disk utility?

    I want to do a disk repair but I don't have an external hard drive to backup information on, so I'm wondering if I can just not back it up and do the disk repair? Does it kill information? How does disk repair even work? Is it a defragger?

  • PT Dumps Oracle 9i DBA

    Hello, can anybody send me latest dumps for performance tunning (ocp) in oracle 9i [email protected] Thanks in advance Regards/Sujith M G

  • Adding Cell in a row in Smart Form

    Hi All, Can anybody please tell how to add a cell in the row of a table in smart forms. Thanks

  • Mandatory in material master with material type wise

    Dear all Is it possible to make a field mandatory in material master with material type wise? kindly help

  • Fed up with verizon

    im so getting fed up with verizon they say they put everything down in their system of every conversation u have with them but it is so untrue ive have soo many problems with thier phones when i talk to every rep or superviser they make agreements wi