Can't get Parent class

I have created three classes.
JMainFrame : JFrame
JMainFramesDlg: JDialog
JMainFramesDlg1:JDialogJMainFrame opens JMainFramesDlg, after that I press a "Edit" button on the JMainFramesDlg and it opens JMainFramesDlg1
if (jdlgEdit == null) {
jdlgEdit = new JMainFramesDlg1(); }
jdlgEdit.setVisible(true);Now, I am in this child Dialog (Edit) and made some edition, changes and press OK, how can I from JMainFramesDlg1 get the instance of JMainFramesDlg and JMainFrame, I want to make some changes in this windows, if some changes in Edit Dialog took place.

Do you have a small sample for that? How can I get the feedback from the Dialog window?
Well, you're extending Dialog, so you can do it any way you like.
I'd quite often use one of three techniques:
1. for simple data, use a getter (eg "public String getPassword()") which shows the dialog modally, and then returns the value stored in a text field in it
2. for more complex data, use a method like "public void requestInput()" which shows the dialog modally then populates fields with the input data, which can be retrieved via methods like "public String getItemName()" or "public int getQuantity()"
3. pass in an object to the dialog, and have the dialog display and operate on it directly - eg pass it a "User" object and have the dialog present text fields which allow direct editing of "name" or "password" or whatever - then all you need is "new UserEditorDialog(myUser).show()" and you're done

Similar Messages

  • Than how can i get java class by using it's class file?

    Hi
    After compilation of a java program, it creates a class file.
    After getting class file suppose class file has been deleted.
    Than how can i get java class by using it's class file?
    Thanks in advance.

    get a decompiler and run your class file through it--I'll assume you want the source code back and that you are not trying to recover a missing class file by attempting to use the class file that is missing--if it's missing, then I've not a clue on how to get it back by using what is already missing.
    BTW: many of your compilers have source control--if it does, just restore your missing file.

  • In wich jar can i get this class org.apache.batik.dom.util.DOMUtilities

    please let me know in which jar file can i get this class and tell me the location for downloading
    org.apache.batik.dom.util.DOMUtilities;
    import org.w3c.dom.Document;

    Hai,
    I think you have to use the xml-apis.jar file from the batik project, which has the class org.apache.batik.dom.util.DOMUtilities.
    Yogesh.

  • How can I get the class(ification)  for an equipment with  BAPI ?

    Hello Experts,
    I have created an Equipment with a BAPI. ("BAPI_EQUI_CREATE")
    and  i  create  the assignment   to a (equipment-)class with the BAPI BAPI_OBJCL_CREATE.
    When I use another BAPI  BAPI_EQUI_GETDETAIL I get all information to the equipment,
    but I don't get the information to wich class is it assigned.
    How can I get this ?
    Thanx in advance

    Hi,
    As Keshav mentioned you can get the classification data by using BAPI_OBJCL_GETDETAIL
    you have to pass the following parameters to it.
    CALL FUNCTION  'BAPI_OBJCL_GETDETAIL'
    EXPORTING
    objectkey =  equipment no in your case
    objecttable = 'EQUI''
    classnum =  Class Name
    classtype =  Class Type
    Thanks.

  • Can't get parent div to expand vertically.

    I know the right column floats and I tried a few things I found online but can't get it!
    http://thecottagesongoldenpond.com/mc_family.html
    AND I'm making all pages from my initial template, so I will need to add "the missing code" to that template - each page may require taller or shorter page..

    So for your footer do a clear:
    #footer {
              clear: both;  
              background-color: #7D6A8A;
              text-align: center;
              height: 100px;
              width: auto;
              color: #FFFFFF;
              font-size: 13px;
              padding-top: 10px;
              font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", "DejaVu Sans", Verdana, sans-serif;
    Or you can make a line break do that:
    </map>
    </div>
    <br class="clearfloat />
    </div>
    and your CSS for the clearfloat class:
    .clearfloat { /* this class can be placed on a <br /> or empty div as the final element following the last floated div (within the #container) if the #footer is removed or taken out of the #container */
              clear:both;
              height:0;
              font-size: 1px;
              line-height: 0px;

  • Where can i get free class to learn my iPad mini?

    I thought i could get free class on my new mini at local store, but when i try to register for class there aren't any.  where can i go to learn how to use my mini? i am a first time user of any apple product.

    Read your manual
    http://manuals.info.apple.com/en_US/ipad_user_guide.pdf

  • Where can i get  WLInitialContextFactory  classes

    Hello all.
    I am making a JMS application , however i am getting the error
    Could not create JNDI API context: javax.naming.NoInitialContextException: Cannot instantiate class: weblogic.jndi.WLInitialContextFactory [Root exception is java.lang.ClassNotFoundException: weblogic.jndi.WLInitialContextFactory]
    Can anyone tell me where can i get the WLInitialContextFactory in weblogic server classses .

    Hi,
    WebLogic Server 10.0 and higher releases, client applications should use the wlfullclient.jar file to provide the WebLogic Server specific functionary previously provided in the weblogic.jar file. You can generate the wlfullclient.jar file for client applications using the JarBuilder tool.
    This is a very powerful Jar file...which can be build using a Simple ANt Script: http://weblogic-wonders.com/weblogic/2010/02/03/building-wlfullclient-jar/
    After making this Jar...Please add this Jar file on clients Classpath.
    Thanks
    Jay SenSharma

  • Javascript can't get parent frame's dom

    the code like this:
    <pre><nowiki>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    </head>
    <input type="hidden" name="username" id="username" value="" />
    <frameset id="MainFrame" cols="0,0,*" border="0" frameSpacing="0" frameborder="no">
    <frame id="left" name="left" src="left.php" noresize scrolling="no" style="padding-left:20px;">
    <frame id="action" name="action" src="right.php" noresize scrolling="no">
    </frameset>
    </html>
    </nowiki></pre>
    does firefox will omit the code:
    <pre><nowiki><input type="hidden" name="username" id="username" value="" /></nowiki></pre>
    so when i in left.php or right.php can't get the input value?

    A good place to ask questions and advice about web development is at the MozillaZine Web Development/Standards Evangelism forum.
    The helpers at that forum are more knowledgeable about web development issues.
    You need to register at the MozillaZine forum site in order to post at that forum.
    See http://forums.mozillazine.org/viewforum.php?f=25

  • Can't get my class's getter method to work properly.

    Hello, I am new to Java programming, although I come from C and C++. This is my first post. I am working on a basic Library application that can Checkout and Return books. Eventually I would like to add the ability to read from and write to an XML file containing data for every book.
    My problem right now is that I cannot get my getter method within my Book class to work properly. When I call getData() from within main, and pass the appropriate arguments, instead of filling the variables with that object's data, it leaves them blank! Please help me.
    Here is my method within the Book class, the person and id_num are private.
    /* Gets general Book Instance Data and fills parameters with it */
         public void getData(String n, int num, String c, String d)
              n = this.person;
              num = this.id_num;
              c = this.checkout_date_string;
              d = this.due_date_string;
         }Here is how I am attempting to use it in main:
    String name = "";
    int number = 0;
    String checkout = "";
    String due = "";
    Book book1;
    /*Sets person = John Smith and id_num = 10763*/
    book1 = new Book("John Smith", 10763);
    /*Gets Checkout (todays) date and sets a due date in 2 weeks*/
    book1.Checkout();
    book1.getData(name, number, checkout, due);
    System.out.println("Book1:\n Checkout Date: " + checkout +
                             "\n Due Date: " + due + "\n Is it late: " + book1.isLate() +
                             "\n Person who checked it out: " + name + "\n ID number: " + number +
                             "\n ");Then, Here is the Output:
    Book1:
    Checkout Date:
    Due Date:
    Is it late: false
    Person who checked it out:
    ID number: 0
    Edited by: 987158 on Feb 9, 2013 11:52 AM

    >
    Well I went ahead and made separate methods to return each value. I suppose that will work just as well, especially since now I don't have to declare a bunch of strings and int's to hold the data and pass to the method.
    >
    Well this would never work anyway
    public void getData(String n, int num, String c, String d)None of those can be changed within the method. Strings are immutable and 'int' is passed by value. Each of those parameters will have the same value after the method exits as they did before it was called.
    Your book class should be using 'setters' to set the value of its instance variables.

  • Can't get extended class to work with asbstract class

    I am having trouble working an extended class to work with my base abstract class. I keep getting this error message: "Fiction.java:4: invalid method declaration; return type required" public FictionBook()" Can someone give me some advice and or guidance on what I need to do? Thanks.
    Here is my abstract class:
    import javax.swing.*;
    public abstract class Book
         protected String bookTitle;
         protected double bookPrice;
         public abstract double setPrice();
    public Book()
              setBookPrice();
    public double getBookPrice()
              return bookPrice;
    public abstract void setBookPrice();
    Here is the extended class that I have:
    import javax.swing.*;
    public class Fiction extends Book
         public Fiction()
              super();
              setBookPrice();
         public void setBookPrice();
              bookPrice = 24.95;
         public String toString()
              return("Fiction Book Price is $" + bookPrice);
    }

    Fiction.java:2: Fiction is not abstract and does not override abstract method setPrice() in BookThis one is pretty straightfoward: Book declares an abstract setPrice() method. In effect is promises "every concrete subclass of Book will define an implementation of setPrice()". But your Fiction class does not do this - it does not give an implementation of setPrice() even though as a Book it is required to do so. That is what the compiler is complaining about.
    Fiction.java:6: call to super must be first statement in constructorThis one is slightly cryptic. If you use super() it must be as the first line of a constructor. You are using it as the first line of Fiction() so that looks OK - until you realise that Fiction() is not a constructor! That's because you declare it as a method returning void. Remove the "void" and the compiler will recognise it as a constructor and will be happy about your use of super().
    Edited by: pbrockway2 on Sep 13, 2008 12:13 PM
    Just a general point: it might be worth writing very brief comments for your abstract class to say what the methods are supposed to do. It isn't really clear what setBookPrice() is supposed to do given that it isn't passed any argument. Likewise setPrice(), how does it differ from setBookPrice()? what is the double value that it returns?

  • Inner classes can't access parent classes in constructor

    I'm having a problem where I have class A, which has an Inner class B, which has it's own inner class C. In C's constructor (the inner most class), i'm trying to access a method of A (the top most class), and I get a NullPointerException with trace:
    at mearns.finance.DefaultPortfolio.access$0(DefaultPortfolio.java:1)
    at mearns.finance.DefaultPortfolio$AccountsEditor$AccountsTableModel.<init>(DefaultPortfolio.java:253)
    In this case "DefaultPortfolio" is class A, AccountsEditor is class B, and AccountsTableModel is class C. The line given in the second stack trace element is the line in C's constructor which calls Class A's method.
    Debugging, I stop inside C's constructor. Before anything happens, debugger says this$1 is null. Then I step, and it calls super(), and now this$1 is an instance of class B (AccountEditor), but it's own this$1 (which should be an instance of class A) is still null.
    I'm calling C's constructor from within B's constructor (but not A's), not sure if that makes a difference.
    Can anyone explain what's going on here, and (hopefully) how I can work around it?
    Thanks for any help.
    When i debug

    hm, I really don't know what is happening but I want to tell you about something that is not nice in your code and possibly it could cause the error.
    Code behaves somwhat strange when you pass this out of a constructor. You do this implicitly when you create an inner classe which implicitly gets a reference to the outer class. Also just simple method calls can cause such effects.
    This is because the construction process it not finished but methods are already called.
    Even worse: the sub classes constructor possibly did not even start. Special to java is the fact that a method call can lead to an overridden method of a sub class who's constructors has not even passed the super() command.
    My guess now is that you have that some kind of this situation in your code. You create an inner class in a constructor. That inner class calls back a method on the outer class. Now say that the method you are calling is defined in a sub class who's constructor still stucks in super() call. There we are.
    I found a thread in a news group that covers exactly this problem:
    It is therefore a good idea only to call private methods from constructors (that should then also call only private methods). Also if inner classes are created in the constructor then they should not call any non trivial / non private methods of the outer class. Calling overridden methods out of constructors should be avoided strictly!
    Perhaps this has nothing to do with your problem. I cannot tell for sure.
    But this sounds quite interesting.
    Please tell me if my guess was right and if not post simple code the illustrated your problem.
    Here a simple example also throwing NullPointerException:
    class Outer {
      int i = 42;
      abstract class InnerSuper {
        InnerSuper() {
          foo();
        abstract void foo();
      class InnerSub extends InnerSuper {
        void foo() {
          System.out.println(i);
      public void bar() {
        new InnerSub();
      public static void main(String[] args) {
        Outer o = new Outer();
        o.bar();
    } It causes a NullPointerException because the InnerSub constructor did not run. I copied the example from a news group thread i found.
    http://groups.google.de/group/comp.lang.java.programmer/browse_thread/thread/897fba792d689b29/a1ba2ed708636a30?q=inner+class+outer+this+reference+NullPointerException&rnum=4&hl=de#a1ba2ed708636a30
    Here is a even simpler example of strange behavior - even without NullPointerExceptions.
    class A {
         A() {
              System.out.println(getName());
         String getName() {
              return "A";
    class B extends A {
         String NAME = "B";
         String getName() {
              return NAME;
    new B();It will output null instead of B.
    regards
    Sven

  • Can't get a class to display properly (TabPanel awt)

    Hi, thank you checking this out.
    I have renewed my interest for Java but need to start at the very beginning again. I have actuallu read up on AWT. Yes yes, I will follow up with Swing but for now I am just testing the waters again.
    However, I cant manage even the simplest of tasks. I want to display a TabPanel and do see something in the created Frame but something is not correct (it certainly is not a TabPanel). Would you have a clue as to what I am doing wrong? The TabPanel is an OpenSource example and I actually do not expect anything wrong with it. It does work with getMinimumSize so I might skip a beat there. Any comment is appreciated.
    This is what I build:
    import java.awt.Frame;
    import java.util.*;
    public class TabPaneltest {
        public static void main (String args[]) {
              Frame f = new Frame();
              f.reshape(176,10,800,600);
            TabPanel T = new TabPanel();
              f.add(T);
              T.setVisible(true);
              f.show();
    //                  (Still have to exit properly etc)// This is the TabPanel class as I found it, I am sure this is a usable error free component:
    // Free to use, can't redistribute for profit
    // Original by Pete Yared.
    // Modified by Jean-Guy Speton ([email protected]).
    //   Version 1.0.
    //   * Changed name to TabPanel to differentiate modification tree
    //     from original.
    //   * JDK 1.1 API compliant.
    //   * CardLayout used to simplify implementation.
    //   * Added getMinimumSize() and getPreferredSize().
    //   * Tab Font stored in state and created only once.
    //   * Tab in index 0 now default selected.
    //   * No longer repaints when user reselects selected tab.
    // Still free to use, still can't redistribute for profit.
    import java.awt.*;
    import java.awt.event.*;
    import java.util.Vector;
    public class TabPanel extends Panel implements MouseListener
         protected Vector labels = new Vector();
         protected Vector panels = new Vector();
         protected Panel cardPanel = new Panel();
         protected int[] tabWidths;
         protected String selectedPanel;
         protected Font tabFont = new Font("Dialog", 12, Font.PLAIN);
         protected Insets insets;
         protected int tabHeight = 21;
         protected int tabWidthBuffer = 13;
         protected int insetPadding = 14;
         public TabPanel()
              insets = new Insets(insetPadding + tabHeight, insetPadding,
                                       insetPadding, insetPadding);
              setLayout(null);
              addMouseListener(this);
              cardPanel.setLayout(new CardLayout());
              add(cardPanel);
    //  Sorry, can't put in full class because of a limit on the characters in the message.
    //  Full code at: http://www2.blaze.ca/~jspeton/java/tabpanel/TabPanel.java     // As said, I'd love to have this thing working as to (start) give me back some 'feel' for java. (It would // look so much better than 'Hello World':) Your remarks are appreciated.
    // Wim

    EsbachW wrote:
    Hi, thank you checking this out.
    I have renewed my interest for Java but need to start at the very beginning again. I have actuallu read up on AWT. Yes yes, I will follow up with Swing but for now I am just testing the waters again.It is a bad idea, in this day and age, to ask AWT questions. The reason is that AWT coding is so distant (in time) for GUI programmers of this millennium, that they forget the details!
    Besides that..
    However, I cant manage even the simplest of tasks. ...Using an Open Source class is not 'the simplest of tasks'. Note also that:
    a) We generally don't support 3rd party APIs on the forums. ..and..
    b) Most people will absolutely refuse to..
    ... // Sorry, can't put in full class because of a limit on the characters in the message.
    // Full code at: http://www2.blaze.ca/~jspeton/java/tabpanel/TabPanel.java
    .....follow a link to 'other code'. It is generally considered that if code is short enough to constitute 'an SSCCE' *(<- link),* then it is something short enough for them to look at. Any longer, and you've lost them.
    An SSCCE is not only a short form of code, but very specific. I recommend you read up on the SSCCE, and post code in that specific form.
    If you want some beginner projects to get you going again in Java, I recommend you put GUIs aside for a while do stuff intended to run from the command line. Use the Scanner class if you need interaction. When you get back to GUIs, launch directly into Swing, because that is the toolkit about which best help is to be had (and also includes a JTabbedPane supported by Sun!).

  • Can't get Parental Controls Preference Pane to load

    On a fairly vanilla iMac (Core 2 Duo, 2 GHz) running Mac OS X 10.5.4 I get the infinite colored pinwheel when trying to get into the Parental Controls pane of System Preferences.
    This has been going on for several 10.5.x releases now, I can't remember exactly when it started.
    I've tried repairing permissions and installing the latest combo updater (everything is up-to-date).
    The error I see in the console is:
    System Preferences[713] * -[NSCFArray objectAtIndex:]: index (0) beyond bounds (0)
    Any and all suggestions are welcome.
    Thanks in advance.

    Thanks - that's nice and clear - so only works if I set-up my children with separate log-on and restrict what they can view in their itunes view?
    Is there any way of achiving the same with one single account?

  • JSPSmartUpload -- Where can i get mySmartUpload class

    Everything references mySmartUpload yet it didnt come with the download. Does anyone know where I can get this from. I search jspsmart.com for quite a while and cannot seem to find it.
    Does anyone out there have a copy or know what i did wrong?
    Thanks for your time!
    Adam

    I realize this is an old message, but I'm just answering for anyone who might peruse this later and need an answer...
    mySmartUpload is the name of the bean instance being used in the application. In the jsp, there should be a line to use the bean like:
    <jsp:useBean id="mySmartUpload" scope="page" class="com.jspsmart.upload.SmartUpload" />
    Then, mySmartUpload is the bean id to use through out the page, such as mySmartUpload.upload(), etc.

  • How can i get all java class names from a package using reflection?

    hi,
    can i get all classes name from a package using reflection or any other way?
    If possible plz give the code with example.

    You can't, because the package doesn't have to be on the local machine. It could be ANYWHERE.
    For example, via a URLClassLoader (ie from the internet) I could load a class called:
    com.paperstack.NobodyExpectsTheSpanishInquisitionI haven't written it yet. But I might tomorrow. How are you going to determine if that class is in the package?
    This subject comes up a lot. If you want to do something a bit like what you're asking for (but not quite) there are plenty of threads on the subject. Use google and/or the forum search facility to find them.
    But the answer to your question, as you asked it, is "you can't do that".

Maybe you are looking for