Class extending a Frame with main method in it - how do I use the methods?

Howdy.
Having a problem.. I want my "main" class, ie. the class with the main method in it to extend a Frame class.. because the main method is static, I can't use Frame's methods.
What's a trick to get around this ? I am making a deliberate design decision to extend the Frame class, because I thought it was.. well.. better. I could always just create a Frame object and utilise it.. but from little things I've read and seen it's better to extend it.
When I use Forte to make a Frame program it sets up a constructor/etc. for the main class and then it does something akin to this (the class is called MazeGenerator) :
public static void main(String args[]) {
new MazeGenerator().show();
What does "new MazeGenerator().show();" do when it's not being associated to an object handle ??
Ta.
- Scutt.

Create an instance of the frame in main then the constructor can control it. Or you could add an init method or something:
class MyFrame extends Frame {
public static void main (String [] args) {
MyFrame frame = new MyFrame();
frame.init();
You don't necessarily have to have a reference to an Object in order to create one. All the work can be done in the constructor (something I'm not really fond of however)

Similar Messages

  • I have an Apple MacBook Pro with 2 USB ports and a MiniDisplay Port. I also have an HDTV with a HDMI port. How can I use the TV as a display without any tethering wires between my computer and the TV?

    I have an Apple MacBook Pro with 2 USB ports and a MiniDisplay Port. I also have an HDTV with a HDMI port. How can I use the TV as a display without any tethering wires between my computer and the TV? I have a MiniDisplay Port to VGA adapter, but there are two issues with it: The new display doesn't have a VGA port, and even if it did, I wouldn't want to have my mac constantly attached to the display by a cable. I was looking for a way to use the TV as a display without any wires. Is there some type of bluetooth setup I could use? Please let me know if you have any suggestions.

    As I wrote above, I think you should look into the Apple TV yourself. The best place to find information about what it can and can't do and to ask your own specific questions is probably in the Apple TV forum, here:
    https://discussions.apple.com/community/appletv/appletv

  • I would like to extend the screen from my circa 2013 27in iMAC with thunderbolt onto my circa late 2006 imac using the DVI port on that iMAC. Is this possible? If not is there another approach I can use?

    I would like to extend the screen from my circa 2013 27in iMAC with thunderbolt onto my circa late 2006 imac using the DVI port on that iMAC. Is this possible? If not is there another approach I can use? My 2006 iMAC is showing it's age but I figure I can use it as just a monitor just fine. Assuming I can connect the two together.

    That older iMac isn't designed to receive video input through the mini-DVI connection. Only certain newer iMacs are able to be used as displays.
    Your only options are to use something like ScreenRecycler mentioned above.
    ~Lyssa

  • HT1338 Dear all, I have just bought a MacBook pro with osx lion on 25thast month. I wanted to know if I can use the methods described above to update to osx mountain lion or I have to buy osx mountain lion from the app store?

    Dear all, I have just bought a MacBook pro with osx lion on 25th last month. I wanted to know if I can use the methods described above to update to osx mountain lion or I have to buy osx mountain lion from the app store?

    Here are the rules to qualify for the free upgrade:
    http://www.apple.com/osx/uptodate/
    (has to be purchased from Apple or authorized reseller).

  • I have a Sony radio in my car.   With IOS  4 on my IPhone I could use the docking plug to the usb input on the radio and stream ESPN radio or pandora to the radio.  After upgrading to IOS 5 on the phone the Sony radio will not recognize the phone .  Any t

    I have a Sony radio in my car.   With IOS  4 on my IPhone I could use the docking plug to the usb input on the radio and stream ESPN radio or pandora to the radio.  After upgrading to IOS 5 on the phone the Sony radio will not recognize the phone .  Any thoughts.

    I am reading on this site about the error I am getting and it wants me to change some files that I am not comfortable messing with. Mainly because it is like a foreign language. Will the store do this for me or tell me if it is neccessary?

  • How do I use the new Airport Express as an extender for a non-Apple router?

    We have an "Arris" router in our house and are thinking of buying an Airport Express to extend the internet. How can we use the Airport express as a repeater on a non-Apple router without having to use millions of ethernet cables?

    Apple designed their "extend a wireless network" to only work with other Apple routers wirelessly, so it would be extremely unlikely like it would work with an Arris wireless router.
    Your best bet is to always use products from the same manufacturer if you need this type of feature on your network to insure compatibility.
    If Arris does not offer a product for this purpose, a "universal" extender like the Netgear device linked below might be able to do what you want. It was not "universal" enough to extend an Apple network when I tested a device recently.
    Universal WiFi Range Extender (WN3000RP) - Netgear

  • How use the method hasPermission in weblogic server 6.1

    Hello everybody !
    In my application web ,i restrict access to some ressources (some jsp)
    to some specified groups .
    So,i create permissions in the file web.xml , as indicated in the doc
    6.0 .
    For example only the user : system can access to all the jsp , and the
    others users no .
    Now ,in my code ,I would like to use the method hasPermission in order
    to modify my application according to the differents groups of users .
    But my problem is that i don't know the parameter aclName !
    For the parameter permission I use the syntax "new
    weblogic.security.acl.PermissionImpl(".../x.jsp") .
    For the parameter sep (char),i use : '.' .
    But i don't find the parameter aclName .
    When i was in weblogic 5.1 ,i created permission in the file
    weblogicURL.policy with the syntax : " Permission
    weblogic.security.acl.URLAcl "weblogic.url",".../x.jsp" " and after
    i gave "weblogic.url" as parameter for aclName .
    But in version 6.0, I try web.xml, web ? but nothing is good .
    Is there any person which have an idea or the solution ?
    All the sugestions are welcome !
    Thanks by advance !
    Good bye .

    hi,
    maybe a better approach could be to use roles instead of permissons.
    Your menu.jsp could look like this:
    <%
    if(request.isUserInRole("super-user"))
    %>
    ... code HTML where the button "Creation" is created
    <%
    %>
    You can map the role 'super-user' to an individual principal or a
    user group in weblogic.xml. In that case only users that are in
    the mapped group/principal will see the 'creation' link. So simply
    add user 'system' to a group 'super-user'.
    regards,
    przemek
    Marc Alfonsi schrieb:
    Hi Kirann and everybody!
    Thanks for your message .
    I'm going to explain better than the first time .
    I set up security-constraints in my web.xml .
    For example only "system" can access to the directory Creation and
    all its .jsp , and the others users no .
    Now ,in my code , there is a jsp : menu.jsp which displays some
    possibilities : creation of an employee , visualisation ...with HTML
    code : button "Creation" which call a .jsp of the directory Creation .
    Actually , if a user different of "system" try to click on the button
    "Creation" there is a dialog box of login . The user writes its loggin
    but the access is prohibited ( because security-constraint in web.xml
    ).It's normal but not very well .I would like that a user who don't
    have access to the functionality "Creation" don't see the button
    "Creation" !
    So in menu.jsp , i would like to use the method hasPermission at the
    location of the button "Creation" is created with HTML code :
    <%
    if weblogic.security.acl.Security.hasPermission(.....,new
    weblogic.security.acl.PermissionImpl("/Creation/x.jsp"),'.')
    %>
    code HTML where the button "Creation" is created
    <%
    %>
    But my problem is that i don't know the first parameter which
    correspond
    to aclName .
    Any suggestions are welcome .
    Thanks for help .

  • How can I use the ScrollTablePane with kodo ?

    How can I use the ScrollTablePane with kodo, taking a result Query as
    a Collection and throw it into the ScrollTablePane , if it not possible ,
    Is there a Component which I can do it ?
    Thanks , Marco Aurelio.

    Marco-
    I am not familiar with any "TableScrollPane" classes. Can you clarify
    whether this is some 3rd party custom component, or something you have
    written?
    Note that we do not provide any pre-build graphical data components with
    Kodo, but we do intend to provide some examples in the future.
    In article <cl1hn7$9ep$[email protected]>, Marco Aurelio Bueno wrote:
    >
    How can I use the TableScrollPane with kodo, taking a result Query as
    a Collection and throw it into the ScrollTablePane , if it not possible ,
    Is there a Component which I can do it ?
    Thanks , Marco Aurelio.--
    Marc Prud'hommeaux
    SolarMetric Inc.

  • How can I use the TableScrollPane with kodo

    How can I use the TableScrollPane with kodo, taking a result Query as
    a Collection and throw it into the ScrollTablePane , if it not possible ,
    Is there a Component which I can do it ?
    Thanks , Marco Aurelio.

    Marco-
    I am not familiar with any "TableScrollPane" classes. Can you clarify
    whether this is some 3rd party custom component, or something you have
    written?
    Note that we do not provide any pre-build graphical data components with
    Kodo, but we do intend to provide some examples in the future.
    In article <cl1hn7$9ep$[email protected]>, Marco Aurelio Bueno wrote:
    >
    How can I use the TableScrollPane with kodo, taking a result Query as
    a Collection and throw it into the ScrollTablePane , if it not possible ,
    Is there a Component which I can do it ?
    Thanks , Marco Aurelio.--
    Marc Prud'hommeaux
    SolarMetric Inc.

  • Junit : How can I get the method name (say testMyAddress) that failed

    My code is below
              TestSuite masterSuite = new TestSuite(testClass);
              TestResult result = new TestResult();
              masterSuite.run(result);
                   Enumeration errors = result.errors();
                   while (errors.hasMoreElements())
                        TestFailure error = (TestFailure)errors.nextElement();
                        Test test = error.failedTest();
    /*will give me the class name but how can I get the method that threw the exception.
    I can get fName (that contains the method name) field to get the method,but being private I cannot hold of the field.
    Wondering if there is any easy way to get the method name that threw exception,without writing unneccessary code
                        Class c1 = test.getClass();
    thx
    m

    getting all methods is no good!
    My test class looks like this
    MyTestClass{
    testGoodData(){
    asserttrue(.....);
    testBadData(){
    asserttrue(.....);
    testNullData(){
    asserttrue(.....);
    someHelperMethod(){
    thx
    m

  • [EWS][Java] How can I use the Search Filter only mails with attachments?

    Hey,
    I'm trying to search a folder ( doesn't matter  which ) for ONLY mails with attachments.
    How can I use the search filter for that purpose? 
    Thanks!

    You can drag the attachment collumn from settings and sort on that collumn
    In the main Outlook window, on the View menu, point to
    Current View, and then click Customize Current View.
    Click Fields. In the Available fields list, click the field that you want to add, and then click
    Add.
    Come back and mark replies as answer if they help, and help others with the same problem. If this post is helpful please vote it as Helpful on the left side.

  • How can utilize/use  the extended space in system.img ?

    Hello Guru's
    In Oracle VM , How can utilize/use the extended space in system.img ?
    a) Increased the system.img size using the following command:
    # dd if=/dev/zero bs=1M count=12960 >> /OVS/running_pool/18_test1/System.img
    b) Verified the added size of system.img file at OVS server.
    # ls -lh System.img
    -rw-r--r-- 1 root root 19G Feb 9 20:58 System.img
    c) Started GVM and additional size/memory is not shown ?
    # df -m
    Filesystem 1M-blocks Used Available Use% Mounted on
    /dev/xvda2 3984 2292 1652 59% /
    /dev/xvda1 92 12 75 14% /boot
    tmpfs 512 0 512 0% /dev/shm
    + Tried working with resizefs , resize2fs , cmd did not work.
    (GVM is created using Oracle provided template)
    + am i missing anything ?
    Oracle VM Setup Detail:
    oracle-logos-4.9.17-7ovs
    enterprise-linux-ovs-5-0.17
    ovs-release-2.2-0.17
    ovs-utils-1.0-33
    kernel-ovs-2.6.18-128.2.1.4.9.el5
    ovs-agent-2.3-29
    Thanks in advance for your help.
    Best Regards
    Basu

    I am not positive what you did is going to work, but it seems like you did the equivalent of imaging a small disk on a bigger disk. In that case, the first thing to do is update the partition table with fdisk. Start with fdisk -l in the vm for general information about the disk. Hopefully, the additional space will show. Then, work with fdisk to use the extra space. The easiest is to add a partition, then a file system on it. It is also possible to expand the last partition (you might have to delete it first), then expand what is on it (may be RAID, LVM, or the file system), layer by layer. As usual with fdisk, you run the risk of thrashing it all, so you may want to practice on a copy first. Obviously, the extra space can only be added to the last partition of the small disk.
    If the situation is more complex, you may have to boot a VM with both the small disk and the big disk at the same time. If you boot the VM off of an iso DVD image, you can then shell out, then run fdisk to partition the big disk the way you want, then use dd to copy the partitions you want in the order you want from the small disk. I am pretty sure not all combinations will work, but you get the idea. You can then take the small disk out, and boot off of the big disk.
    Come to think of it, you might just be better off with adding more space as a second virtual disk. You would then be free to partition/format it the way you want without messing with the first disk. Linux is so good with disk management, so many options.
    As a general statement, though, I like to put some distance between the high level file systems and the low level disk partitions, so I use LVM (Logical Volume Manager).
    Best of luck, keep us posted.

  • Fetching data using the method query

    Hi experts
    Using the class /scmtms/if_lcp and using the method query, how to fetch the data from the business objects.
    my requirement is i need to fetch the data from the BO /SCMTMS/FRIEGHTORDER and  /SCMTMS/SHIPMENTREQUEST.
    If any one can send the sample code for this, it will be very usefull for me.
    Thanks in advance
    sai
    Edited by: sai sai on Jun 17, 2009 5:21 PM

    report  z_fo_read.
    data:
      lr_fro        type ref to /scmtms/if_lcp,
      lr_lcp_transaction type ref to /scmtms/if_lcp_transaction.
    * step 1
    lr_lcp_transaction = /scmtms/cl_lcp_factory_adapter=>get_lcp_transaction_handler( ).
    * Schritt 2:
    lr_fro = lr_lcp_transaction->/scmtms/if_lcp_facade~get_lcp( in_bo_name = /scmtms/if_freightorder=>co_bo_name ).
    constants: co_do_prefix_root_tpcharges type string value 'TRANSPORTCHARGES.ROOT'.
    * Schritt 3:
    data:
      ls_params        type /scmtms/s_srq_rt_a_block value is initial,
      ls_root_data     type /scmtms/if_freightorder=>ty_root,
      ls_selection     type /scmtms/s_selection_parameter,
      lt_out_messages  type /scmtms/if_srvmgr_types=>ty_messages,
      lt_out_node_ids  type /scmtms/t_bo_node_id,
      lt_root_data     type /scmtms/if_freightorder=>tt_root,
      lt_items_data    type /scmtms/if_freightorder=>tt_transportchargesinfo,
      ls_items_data    type /scmtms/if_freightorder=>ty_transportchargesinfo,
      lt_selections    type /scmtms/t_selection_parameters,
      lv_action_name   type string,
    *     Notification structure
      ls_change_notifications type /scmtms/if_srvmgr_types=>ty_change_notifications.
    * A) Root-ID des SRQ holen, der ge-/entsperrt werden soll:
    ls_selection-attribute_name = /scmtms/if_freightorder=>co_attr-root-for_id. " ID.
    ls_selection-sign   = 'I'.
    ls_selection-option = 'EQ'.
    ls_selection-low    = '00000000000000000000000000000000800'.
    *ls_selection-high   = '00000000000000000000000000000000427'.
    append ls_selection to lt_selections.
    call method lr_fro->query
      exporting
        in_bo_node_name         = /scmtms/if_freightorder=>co_bo_node-root
        in_query_name           = /scmtms/if_freightorder=>co_query-root-root
        in_selection_parameters = lt_selections
      importing
        out_node_ids    = lt_out_node_ids
        out_messages    = lt_out_messages.
    * B) Daten holen:
    call method lr_fro->retrieve
      exporting
        in_bo_node_name        = /scmtms/if_freightorder=>co_bo_node-root
        in_node_ids            = lt_out_node_ids
      importing
        out_data               = lt_root_data
        out_messages           = lt_out_messages.
    read table lt_root_data into ls_root_data index 1.
    The above code is a snippet, extract useful information for you.

  • HT2204 I have recently immigrated to the US but my apple ID is still stuck with my previous country. How do I change the country? Preferably without using a credit card

    I have recently immigrated to the US but my apple ID is still stuck with my previous country. How do I change the country? Preferably without using a credit cardI've only been here in the US 2 months and still have no US credit card.

    Your credit or debit card credentials must be associated with the same country where you reside.
    "Although you can browse the iTunes Store in any country without being signed in, you can only purchase content from the iTunes Store for your own country. This is enforced via the billing address associated with your credit card or other payment method that you use with the iTunes Store, rather than your actual geographic location."
    From here >  The Complete Guide to Using the iTunes Store | iLounge Article

  • How can I use the old Apple TV with new iTunes?  It tells me to input a code in iTunes but iTunes no longer has a spot to input this code to allow sync.  I can access the iTunes Store fine, just none of my Library

    How can I use the old Apple TV with new iTunes?  It tells me to input a code in iTunes but iTunes no longer has a spot to input this code to allow sync.  I can access the iTunes Store fine, just none of my Library

    read this
    https://discussions.apple.com/message/20429789#20429789

Maybe you are looking for

  • How to import bookmarks from one macbook pro to mac air?

    Im wondering if there is a simple way to import bookmarks from Macbook Pro to Macbook Air using Safari?

  • Find all values in an array?

    I have an array and I want to output ALL the index values that correspond to a particular value.  The Search 1D array only returns the first index, is there a VI that returns them all?  Thanks.

  • 64-bit Linux driver/associated SPE API for the Omnikey CardMan 3821 card reader

    I am in the process of converting from a 32 bit to a 64 bit Linux machine. In the past I was able to use the SPE API for 32 bit Linux along with the 32 bit Linux ifdokccid device driver. However, using the speapi_lnx-amd64-1.0.1 along with ifdokccid_

  • Alignment page not printing after installing new cartridge

    I just installed a new ink cartridge on my 1210 printer and the cartidge alignment page will not print. My printed docs look like I am using a shadow font. How do I get the alignment page to print?

  • Finding my pics on finder

    please just a simple way to find my pictures on Finder please? Media - Photos does not appear when opening Finder.... stupid naturally some of my old pics are not under iphoto, but apparently in "Media" please no more advice on mac db filestructure,