Why we extend JFrame in java swings? how is it different from code not ...?

how is it different from code nt extending JFrame?
please explain the role of contentpane in both cases?
thanx

Search the net for examples and/or explanations of "inheritance vs composition.
For the role of a contentPane, read the API for interface RootPaneContainer and class JRootPane. The second named API also has a link to the Swing tutorial on How to Use Root Panes.
db

Similar Messages

  • What is Lightroom for?  How is it different from Photoshop?

    What is Lightroom for?  How is it different from Photoshop?

    Hi stephen,
    for detail information, read this : https://forums.adobe.com/message/4568487
    regards

  • Wat is work flow and how is it different from bpm

    wat is work flow and how is it different from bpm

    Hi, please put a bit more effort in your quest for knowledge. This link:
    <a href="https://wiki.sdn.sap.com/wiki/display/HOME/BusinessProcessManagement">https://wiki.sdn.sap.com/wiki/display/HOME/BusinessProcessManagement</a>
    is accessible from this forum and has everything you need to know. I suggest you first read everything there is to find there.
    Kind regards, Rob Dielemans
    Message was edited by:
            Rob Dielemans
    Rob Dielemans

  • Why we extends JFrame class in java

    Hello Java Developers,
    I am new to Java & Currently I am trying my hands on Java Swings.
    I wrote a very simple program in Java to display a JFrame on screen. My code is as follows:
    import javax.swing.*;
    public class JavaFrame {
    public static void main(String args[]){
    JFrame frame = new JFrame();
    frame.setTitle("My Frame");
    frame.setSize(400, 150);
    frame.setLocation(300, 300);
    frame.setVisible(true);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    I saw some examples on internet & they are extending "JFrame" in their every example. I want to know what is the benefit of this ??? here is code:
    import javax.swing.*;
    public class JavaFrame extends JFrame {
    public static void main(String args[]){
    JFrame frame = new JFrame();
    frame.setTitle("My Frame");
    frame.setSize(400, 150);
    frame.setLocation(300, 300);
    frame.setVisible(true);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    My second question is what is the meaning of line "frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);"
    frame - This object of class created by me.
    setDefaultCloseOperation() - This is predefined method in JFrame class.
    JFrame.EXIT_ON_CLOSE - what is the meaning of this ??

    I saw in JFrame API as you suggested & I found that
    EXIT_ON_CLOSE is an "public static final" method.Look again. It's not a method.
    final: this mehod must be executed
    am I right ???No. final means that the value cannot be reassigned.
    Use code tags to post codes -- [code]CODE[/code] will display asCODEOr click the CODE button and paste your code between the {code} tags that appear.
    db

  • How to migrate documents from Lotus Notes to Stellent Repository

    Hi All,
    I want to migrate almost 5000 documents from Lotus Notes to Stellent Repository. Is there any way to achieve this functionality?
    how to integrate both the things please let me know.
    Regards,
    Vishal Shah

    Hey Vishal,
    one approach could be
    1) fetch all the documnets and metadata (wat ever you need) from the Lotus Notes repository using java+Lotus API 2) write a BatchLoad script file using the metadata you have. And then start the batch loader.
    other approach could be to
    1) fetch all the documnets and metadata (wat ever you need) from the Lotus Notes repository using java+Lotus API
    2) Checkthem in using the WSDLs.
    There is one thing thought that even i would like to know its which of the two will perform better ?
    regards,
    sapan

  • How is JSTL different from JSP?

    What is JSTL & how exactly is it different from JSP?Is it more powerful than JSP,Where can it be used & can i get an example of it.

    JSTL is addition to JSP technology. It is set of html-like custom tags, that allows web page developers to do typical tasks without coding in java, but using reusable out-of-the-box tags.
    like
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
    <html>
    <body>
      <h1>Formatting with the default locale</h1>
      <jsp:useBean id="now" class="java.util.Date" />
      Date: <fmt:formatDate value="${now}" dateStyle="full" />
      Number: <fmt:formatNumber value="${now.time}" />
    </body>
    </html>Take a look at http://java.sun.com/products/jsp/jstl/ for more details

  • New at Java Swing, How to position cursor?

    I'm new at this, but I would like to know how to position a cursor in either a JTextField or JTextArea?
    Any help here would be appreciated.
    Tks Ran

    JTextField.setCaretPosition(newPosition);See also:
    http://java.sun.com/j2se/1.4/docs/api/javax/swing/text/JTextComponent.html#setCaretPosition(int)
    (sorry that the link doesn't work, but it's the forum, not the link... just browse downwards for setCaretPosition(int) )
    Cheers!

  • Why doesn't text in Java Swing applets show?

    See http://sambaker.com/econ/elast/elast.html
    This web page works OK on PCs.  Not on my MacBook Pro.  On my MacBook Pro, text is missing from some of the first Java applets on this page. 

    Be sure that the font color is different than the background color
    Increase the pt size in the tool's option bar beyond the presets. You can enter a number manually.

  • Java - Axis2: How to get an error code / error message from the Javascript via SOAP

    Hi
    In our Java applicsation we call a Javascript in a Indesign CS Server using the following code:
    --- SNIP BEGIN ---
    // calls the remote service on the indesign server
    try {
    // create service
    ServiceStub oIndsgnSrvStub = new
    ServiceStub(sIndesignServer);
    // create service parameter
    ServiceStub.RunScriptParameters
    oIndsgnSrvRSParams = new ServiceStub.RunScriptParameters();
    // create arguments with source- and target-file for parameter
    ServiceStub.IDSPScriptArg[] oIndsgnSrvSArgs = new ServiceStub.IDSPScriptArg[2];
    oIndsgnSrvSArgs[0] = new
    ServiceStub.IDSPScriptArg();
    oIndsgnSrvSArgs[0].setName("xml-input");
    oIndsgnSrvSArgs[0].setValue(sSourceFile);
    oIndsgnSrvSArgs[1] = new
    ServiceStub.IDSPScriptArg();
    oIndsgnSrvSArgs[1].setName("output-file");
    oIndsgnSrvSArgs[1].setValue(sTargetFile);
    // define service parameter
    oIndsgnSrvRSParams.setScriptArgs(oIndsgnSrvSArgs);
    oIndsgnSrvRSParams.setScriptFile(sScriptFile);
    oIndsgnSrvRSParams.setScriptLanguage("javascript");
    oIndsgnSrvRSParams.setScriptText("");
    // create runscript
    ServiceStub.RunScript oIndsgnSrvRS = new ServiceStub.RunScript();
    // set parameter
    oIndsgnSrvRS.setRunScriptParameters(oIndsgnSrvRSParams);
    //$$$ there should be an answer returned by the InddSrvr
    // execute SOAP call
    ServiceStub.RunScriptResult oIndsgnSrvRes = oIndsgnSrvStub.RunScript(oIndsgnSrvRS);
    if(oIndsgnSrvRes.getErrorNumber() == 0) {
    oServerProdJob.setProdState(CBP_Constant.REMOTEPRODUCTIONSTATE_SUCCESS);
    bOK = true;
    } else {
    oServerProdJob.setProdState(CBP_Constant.REMOTEPRODUCTIONSTATE_FAILURE);
    bOK = false;
    //$$$ should be set, if there is something returned by inddsrvr
    //oServerProdJob.setErrorMsg(sErrorMsg);
    } catch(Exception e) {
    sError += e.getMessage() + "\n";
    bOK = false;
    --- SNIP END -----
    The problem is that we don't get the error code and/or the error message from the Javascript in oIndsgnSrvRes. The error code is always 0 if I set an Integer value as return in the Javascript. If I set a String, there is an Exception in the Java application.
    Here is the Java script we use:
    --- SNIP BEGIN ---
    main();
    main()
    var sError = "";
    var sXMLInput = "";
    var sLayoutPath = "";
    // get the SDKCodeSnippetRunner object
    var cbpAdapter = app.cbpCbpadapterObject
    if (cbpAdapter) {
    sXMLInput=app.scriptArgs.get("xml-input");
    sLayoutOutputFile=app.scriptArgs.get("output-file");
    sError = cbpAdapter.doProcess(sXMLInput, sLayoutOutputFile);
    return sError; // This give an Exception; if I return an Integer the ScriptResult is always 0
    --- SNIP END -----
    If I try this with the test application from Adobe I get the error code correctly. But in the Java application, using SOAP, I can't get the error code.
    What could be wrong?
    Any ideas?
    Thanks a lot for the support.
    Kind regards
    Hans

    user11340104 wrote:
    Hello -
    i am calling sqlplus from a bash shell script. If the sql statement generates an error, how can I return that error code (unsuccessful) back to the bash shell?
    Well, let google be your friend,
    http://www.google.co.in/search?rlz=1C1GGLS_enIN327IN327&sourceid=chrome&ie=UTF-8&q=sqlplus+error+codes
    There are many threads I guess talking about the same issue.
    HTH
    Aman....

  • How to execute app from code in Mac OS X?

    I would like to launch another application from my Java code which will run on OS X. Doesn anyone know how to do this? I think it involves the "Runtime.getRuntime.exec()" method, but I'm not sure how to tell it which application to launch.
    Thanks

    Apple has a technote that describes what you are looking for:
    http://developer.apple.com/technotes/tn/tn1168.html

  • I'm looking into buying a prepaid phone from verizon on the website..do you think prepaid is good? how is it different from contract?

    right now i'm with sprint.i really hate sprint..there service isn't good at all.my contract is up in 2 months.so ive been buying phones from all these prepaid carriers and there service isnt reliable at all.i just buy them to see how there service are..i know it sounds dumb.so anyways that's why i come here...verizon is known for being reliable..so my point is,do you think i should go with verizon prepaid?are there prepaid services good? do you think its a good idea to go with verizon? i just need some advice cause i was gonna port my number from sprint to verizon..so i just need people's opinions..
    i am done with 'contracts' so i wanna go prepaid..i dont feel like signing another contract...plus i travel so thats why im considering verizon.

    In a roaming network, your "main" router is the device that would require port mapping/forwarding to be configured in order to access the IP camera from the Internet. This router is also the one that would be provide the private IP address for the camera which you will want to be a static one.
    So as you described your network, the IP cameras should be getting an IP address or you assigned it a static one and this is the address that you would enter in the Private IP address (or equivalent depending on the router used) field when setting up port mapping.
    If you are not able to access this camera from the local network, then this should be troubleshot first.

  • How to separate UI from code

    I usually create front panels that are an interface to read/write parameters via serial modbus.
    So the main front panel is composed as follows:
    1) on the top, some controls to set COM, modbus address, load/save button, read/write button
    2) a textbox control
    3) the parameters' list, each parameter has a checkbox (used by write button)
    this list is organized in maximum 2 columns, of 16 row each. (If I need more parameters, I use a tab control to group them).
    Each row is like:
    <caption string description><label><control> <checkbox>
    So FOR EVERY instrument/product, I must create these list of parameters.
    It's annoying when you have to manage 50 products, each with 32/70 parameters.
    So I am trying to abstract this task, and I thought to describe the parameters in a XML file, then create a sort of "generic" UI that load the XML at startup, and populate the UI based on XML information I provide.
    How can I do this in Labview if labview natively couples a variable to a UI control element?
    I mean: in labview you cannot create a "int x=0;". What you receive is a int variable + its UI control on the front panel!
    The entire system has code coupled with front panel.
    New VI = front panel + diagram.
    I want to separate them, because it's inefficient in my case!
    Anybody heard about Windows Presentation Foundation (WPF)?
    Any ideas is appreciated, even small simple VIs to test some ideas, because I'm in a dead end.

    Slyfer wrote:
    Anybody heard about Windows Presentation Foundation (WPF)?
    Any ideas is appreciated, even small simple VIs to test some ideas, because I'm in a dead end.
    Never heard of teh WPF, does that rule me out from replying?
    I have more ideas than I can post (time limits).
    You can create variables in LV! They are the wires. Put a free label on them if you want a name associated with them.
    FP controls and indicators are NOT variables, they are graphic widgets that should be thought of as being an I/O device and all interaction with them limited to getting info form the user or updating a display (yes dispaly a COPY of the data that lives in the wire)
    I suggest you learn how to use control references. Prior to LV 6i, LV did not have control references and all GUI tricks had to be done in the BD of the GUI VIs. WIth control refeences we can push graphic updates down into sub-VIs. Somewhere arounf LV 8, we got teh ability to do dynamic events which let us push UI operations down into sub-VIs. This image shows waht is a "typical" top-level VI that I delever these days.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How is Parameters.Result used in callback? How is it different from Parameters.Step.Result?

    Hello,
    I have searched TestStand reference manuals, help, and the forums, and I haven't yet found exactly how Parameters.Result should be used in callbacks (if at all).
    I'm trying to figure out how to take a step that normally is not recorded in the result list, and force it to be recorded on the infrequent occasions that it fails. I'm thinking I should be using the Result, but I'm not sure how.  If I set Parameters.Step.RecordResult = True then the step does get set to record results, but that seems to be permanent in the sequence file and AFTER the failure goes unreported.
    Thanks in advance for your expert help!
    - Gizmogal
    Solved!
    Go to Solution.

    In stepping through the SequenceFilePostResultListEntry I finally discerned the difference between Parameters.Step.Result and Parameters.Result, which is only visible at run time:
    Parameters.Result has a TS container which refers to the current step, giving information such as StepGroup, StepName, StepType, among others. Its results-related properties are equivalent to the Parameters.Step.Result properties as far as I can tell.
    Parameters.Step.Result has a much more extensive TS container of type TEInf which appears to be test executive information.
    It seems kind of backwards from what I would expect, but there it is.
    I'm partway through shifting my paradigm - recording all results and then discarding those not of interest. I ended up adding a status string "RecordAlways" to force some steps to be recorded every time, and I toss any that are not equal to that or "Passed", "Failed", "Error", or "Terminated". It's working pretty well so far.
    Thanks again for your help!
    - Gizmogal

  • ITunes 11.1.5 (5) -How to Adding Artwork from scan not working

    I'm reading in a bunch of old CDs.  I am scaning the artwork.  I get the Info window with the Artwork prompt.  I can copy/drag the artwork in and it displays correctly. Permissions seem OK.
    OK does nothing... ??? can't find help ... that works.  Believe all patches and upgrades are current.
    WSH

    No Add button is displayed, however the code is clearly there as I can double click the Artwork input box in the Get Info window. As with all the methods, that allows me to select the artwork, adds it to the Artwork input box and it all disappears when I select OK.  <sigh>  Am I close? Because I am not sure I am seeing the "Artwork Tab" you are describing. There is a radio button next to the Artwork box that automatically activates when any of the methods adds artwork to the input.  In the Multiple Item Information popup window (after Get Info) I see an "Artwork header" over the area that displays the imported artwork. But no "Add" I have "Info, Video, Sorting and Options" tabs at the top of that window.
    When the art work is displayed (all methods) the OK button pulses bright/dim. Then when OK is selected the artwork disappears.
    Sorry to be so dense.  I really appreaciate your attempt to help!  Thank you.
    If I knew how to do a window capture in IOS, I'd show you what I'm looking at...
    WSH

  • What is JHeadstart and how it is different from Jdeveloper

    Hello everbody
    I am new to JHeadstart but iam quite aquinted with Jdeveloper 10.1.3, so can any body please tell how JHeadstart is better than Jdeveloper and what extra thing can we do with it

    JHeadstart is a plug in to use with JDeveloper. If you go to the JHeadstart product center you can read all about its features and benefits. http://www.oracle.com/technology/consulting/9iServices/JHeadstart.html
    Good luck!

Maybe you are looking for

  • How can I convert (or switch) the RGB percent values from the LR histogram into RGB values which are shown e. g. in PS/CameraRAW?

    In LR 5.5 (same in previous versions) the RGB values in the histogram are shown in percent (relativ) values. I prefere to see the absolute values, but I can`t find any way to switch. Maybe this option is intentional disabled, because LR works in 16-B

  • Unable to print or save a pdf

    I have Adobe X and my operating system is Windows XP.  I just last week started not being able to print or save a pdf file.  I get this message and then the program closes: "Adobe Reader has encountered a problem and needs to close.  We are sorry for

  • Getting fed up with Apple TV

    Let me just say, I love the concept of Apple TV.  When it works, it's great. I've got two Apple TVs (2nd gen), both connected wirelessly (not by choice...at the moment, that's all I can do).  They're connecting to my Airport Extreme (802.11n) to get

  • Passing Relational operator along with input

    Hi friends I have a procedure get_emp_list(p_sal in varchar2 p_out out sys_refcursor) as begin open p_out for select * from emp where sal (=,<,>) p_sal; end; Friends pls help me in writing the query, The input will be like <1000 or >1000 or =1000. Re

  • Start your software updater : Aperture 3.2 and iPhoto 9.2

    Lion 10.7.2 with icloud recovery hd update for 10.7.2 itunes 10.5 aperture 3.2 iphoto 9.2 ios5 , new apps , new manuals. icloud.com is live wow.