Linking Jframes via a button

Hey first off i'd like to appologise im a bit new to making GUI's in java
I was wonderign how to connect the two following sections of code so that the first with the button connects to second so its
a) a smooth transition between the 2 and
b)so it opens as a pop up window
import java.awt.*;
import javax.swing.*;
public class frontPage extends JFrame
public frontPage()
setTitle("Learning tool for Natural Deduction");
Container contents = getContentPane();
contents.setLayout(new GridLayout(0, 1));
contents.add(new JLabel("Front Page"));
JPanel fp = new JPanel();
contents.add(fp);
fp.setLayout(new GridLayout(2, 0));
JButton myButton = new JButton("Hello World!");
fp.add(myButton);
setDefaultCloseOperation(EXIT_ON_CLOSE);
pack();
public static void main(String [] args)
frontPage thefrontPage = new frontPage();
thefrontPage.setVisible(true);
import java.awt.Container;
import javax.swing.JFrame;
import javax.swing.JLabel;
public class HelloWorld extends JFrame
public HelloWorld()
setTitle("Hello World");
Container contents = getContentPane();
contents.add(new JLabel("Hello World!"));
setDefaultCloseOperation(EXIT_ON_CLOSE);
pack();
public static void main(String [] args)
HelloWorld theHelloWorld = new HelloWorld();
theHelloWorld.setVisible(true);
Thanks
Edited by: watersa8 on Feb 6, 2008 2:45 PM

watersa8 wrote:
sorry this was my first post i searched for the forum on google and linked me here i realised it was better placed in the other forum.....No problem, but to avoid the volunteers here duplicating effort and then getting pissed at you, you should post a statement here that tells everyone that you've done this and also post a link to the other thread.

Similar Messages

  • How to add an outside url link to a navagation button in Dreamweaver Cs5.5

    How or can I add an outside url link to a navagation button in Dreamweaver Cs5.5. If I try the properties/link it says that the link is an html and not a css.....
    Thank you

    Linking is done in HTML, not CSS (with the exception of a link to a background picture)
    So, if your navigation is a list, you'd have the following in your HTML:
    <nav>
         <ul>
              <li><a href="index.html">Home</a></li>
              <li><a href="about.html">About</a></li>
              <li><a href="books.html">Books</a></li>
              <li><a href="http://www.myexternalwebsitelink.com/inboundfromotherwebsite.html">External Link</a></li>
              <li><a href="contact.php">Contact</a></li>
            </ul>
    </nav>
    Here, in the example above, I'm using the HTML5 <nav>, but that could be an HTML4 <div class="nav"> and you will see a link to an internal page on the same website server for Home, About, Books and Contact with "External Link" pointing to another website external to the one we're on.
    Make sense?

  • I cannot update my Apps from iTunes store message says unable to connect but can connect via iTunes button not apps button ?

    I. Am unable to update Apps from iTunes via the apps button messages says unable to connect but can access iTunes directly via iTunes button on iPad
    Cheers

  • Passing "-t" option to link-editor via CC

    Hi!
    Here is the simple task.
    we have some source file which is compiling with simple command:
    CC ./some_simple_file.C -lsome_lib -lanother_libCompilation process succed but we have the warning message:
    ld: warning: symbol ‘array’ has differing sizes:
    (file /path/libsome_lib.a value=0x4; file /path/libanother_lib.o value=0x8);
    /path/libsome_lib.a definition takenWell, apart from this warning - all works fine and the link-editor do matching symbol correctly in this case.
    To do not confuse users/parsers/mgrs team - we decided to remove this warning. Ok, here is a quote from sun linker document about "how to remove such warning" in section "Symbols Processing"->"Complex resolution":
    +....In both of these cases, the diagnostic can be suppressed by using the link-editor's -t option....+
    Thats nice! Lets go with this new option:
    CC -t ./some_simple_file.C -lsome_lib -lanother_libWe finally removed warning. But...oops! weve got another one!
    CC: Warning: Option -t passed to ld, if ld is invoked, ignored otherwiseQuestion! How we can pass -t option to the link-editor via CC cmd call and without any warnings?

    There doesn't seem to be a way to pass -t to the linker without the warning. You could file a request for enhancement via your Oracle support channel, if you have a service contract. Or you could file one at [http://bugs.sun.com]. (I'm not sure if that site is still active.)
    The best solution is to fix the problem and eliminate the reason for the warning, by making the declarations consistent. You might suppress warnings that matter if you always use -t.

  • In firefox I am unable to submit information via form buttons. The buttons are present and clickable but nothing happens once they are clicked.

    I am having trouble submitting information via form buttons. I click on the button but nothing happens. It isn't site specific and is a problem that has only started to happen recently. I have uninstalled firefox and reinstalled it without any rememdy. The problem does not replicate itself in Chrome or Internet Explorer. Can anyone advise what maybe the problem? Is it s a javascript setting within firefox that I may have accidentally turned off? Please help.

    Thank you for the help but I found the answer here: http://support.mozilla.com/tiki-view_forum_thread.php?locale=en-US&comments_parentId=601699&forumId=1
    I am pretty sure you had the same diagnosis and solution to start it in safe mode, and if it does work, go disabling each extension one by one until you determine which extension is the culprit.
    Thanks!

  • How do I redirect to a page via a button but also populate a field on page2

    I am trying to redirect to a second page via a button but at the same time populate a item on the second page from a function that returns a sequence.
    I tried all sort of methods, adding page processing, adding dynamic actions, adding branching and cannot get this to work.
    The button must create a new record on the second page, but populate unique key at the same time. Because redirecting does not Submit, adding page processing AFTER submit does not work. I get that, but the following also will not work and I don' know why
    Create dummy field on page 1
    Create page processing that populates the field via PL/SQL "On Submit"
    Create Region button that simply Submits page
    Create branch that on submit redirects to second page and moves the value from the dummy field on first page to the field on the seocnd page.
    I am new to Application Express and love trying to figure issues out myself but am at a loss with something that should be so simple. Any help would be appreciated.
    Stewart

    Hi,
    As i understand from your requirement,
    I am trying to redirect to a second page via a button but at the same time populate a item on the second page from a function that returns a sequence.You want to goto page 2 from page one on click of a button, and when loading the page two you want to populate the item on page two with a sequence number.
    if that is the case, try using Button,
    Action: Redirect to page in this application
    then on page two, create a page process,
    Process Point:*On load before header*
    Source >> Process >>
    begin
    select seq_name.nextval into :P2_ITEM from dual;
    end;this should do your requirement.
    Regards,
    Little Foot

  • Delete Attachment link and the launchWebdynpro button in the UWL iview

    Hi,
    Can anyone help me in deleting or hiding the Attachment link and the launchWebdynpro button in the UWL iview. I dont want to do it in the iview properties which would affect all the tasks. Is there a way I can do it in the backend.\
    I appreciate the help.
    Thanks

    Hi Surjith,
    I have the same problem. How can I remove the link? After I called the mentioned function module, the attachment was removed (content) but in the UWL the file name is still there:
    From UWL:
    myFile.pdf by WF-BATCH (94 kb)
    myDeletedFile.pdf   <-- I removed this one with the function module
            CALL FUNCTION 'SAP_WAPI_ATTACHMENT_DELETE'
              EXPORTING
                workitem_id     = me->mv_wf_instance_id
                att_id          = ls_att_id
                delete_document = abap_true
              IMPORTING
                return_code     = lv_return.
    Could you please help me?
    Thanks,
    Thomas

  • I open a new webpage in a new tab. I then go to a link and the back button does not allow me to go back to the original webpage. Any suggestions?

    I open a new webpage in a new tab. I then go to a link and the back button does not allow me to go back to the original webpage. Any suggestions?

    I don't think you understood the question. I am having the exact same issue. I open a link in a new tab or window, for example: https://addons.mozilla.org/firefox/addon/backforedrop/
    When the new tab opens, I click on "reviews" to open the link: https://addons.mozilla.org/en-US/firefox/addon/backforedrop/#reviews in the existing tab because I want to see the reviews for this feature. After I read the reviews, I want to go back to the main link, but the back button on my browser is greyed out, as though I was never even on the previous page. So my options are 1) Open every link I ever click on in a new tab or window, or 2) Hope the website is user friendly and attempt to navigate back to the previous page using links inserted on the current page.
    You never realize how frustrating not having back button is until it happens.

  • Power ran fully out on my MacBook Pro and is currently recharging. However, cannot get it to restart. Totally dark and have tried to deactivate via power button, keys and track pad but get no response

    Power ran fully out on my MacBook Pro and is currently recharging. However, cannot get it to restart. Totally dark and have tried to deactivate via power button, keys and track pad but get no response

    Sulapeace,
    for how long has your MacBook Pro been recharging? Has the light on your MagSafe connector changed color since you’d started recharging it? What do your battery level indicator lights show when you press the button next to them?

  • Creating custom command link rather than command button

    Hi
    I have a custom component which I extended from UICommand. I am trying to show it as a link but it shows up as a button. I know that both command_link as well as command_button are UICommand components... How do I make my custom component show up as a link rather than a button?
    Thanks

    Hi
    I have a custom component which I extended from
    UICommand. I am trying to show it as a link but it
    shows up as a button. I know that both command_link as
    well as command_button are UICommand components... How
    do I make my custom component show up as a link rather
    than a button?
    ThanksThe renderer actually used is based on the value returned by getRendererType(). If you are subclassing UICommand but not overriding this (or setting it in some other way), you're going to find that the default renderer type for a UICommand is "Button". You'll want to change it (to "Link" in this case) to select the hyperlink rendering.
    Craig

  • Is there some way I can insert and play these additional audio files, accessible via separate button

    I am converting a CD-ROM course to an online format with that software.
    In the majority of slides created I have used the Import Audio function to insert a primary audio file containing important curriculum information.
    This file typically activates the moment you open the slide.
    So far so good.
    However, in many slides I also need to insert some secondary audio files.
    While the Import Audio function permits me to splice several files into one, this isn't what I want.
    Instead, I need to insert one or more additional audio files that can be activated independently via separate buttons on a given slide.
    I can in fact do this with the Insert Button function, but in the process a Windows Media Player file opens when I convert the project into HTML.
    My question:
    Is there some way I can insert and play these additional audio files, accessible via separate buttons, without creating and opening a Windows Media Player file?
    Thanks

    It is hard to assess the situation without sitting at your computer and having a look myself.  First, if you're seeing space savings I doubt all your files are a compressed format.  Frequently if you try compressing a compressed format file such as AAC (don't confuse with AIFF) you will actually find the file gets larger because there is overhead to compression and if it cannot compress any more then you end up just adding overhead on top of no savings.  Second, normally if you zip the iTunes library it would basically make it inaccessible to iTunes and iTunes would make you a brand new library or at least flag all your tracks as missing (as you are seeing ain part).
    I don't know what computer you are running, which operating system, which version of iTunes.  Unless they have done something radical in Lion in terms of letting you zip your iTunes folder and still have it functional, you either didn't zip the whole thing, or... I don't know.  One scenario is that somehow your media have been split up and you have them in several locations.  One isn't really part of your library except for 80 tracks, so when you compressed it (and I still am puzzled by the compression unless it was AIFF files you were no longer using), it didn't really make much difference to the playability.  Then you have an untouched library elsewhere.
    Use the Reveal In Finder command to see where some of those problem files are located vs. where the playable files are located.

  • I would like to clear my address row history completely, but I never get it totallly emptied. The remaining addresses are not bookmarked, i.e no stars on the row, but still exist after I have emptied all history both via the History link and via the Tools

    I would like to clear my address row history completely, but I never get it totallly emptied. The remaining addresses are not bookmarked, i.e no stars on the row, but still exist after I have emptied all history both via the History link and via the Tools link. How come adresses still can exist after I have done this?
    == This happened ==
    Not sure how often

    I clear all history but i still get hints (what i've typed before) when i wanna type something in a site i've visited before!! whats the solution?

  • LiveCycle ES2 - add cc to Submit via Email button

    I did find a discussion on this subject but I am unable to view the sample provided.
    I need to add a cc address to the Submit via Email button on a form designed in LiveCycleES2.
    I don't see where I can edit the script on the button.
    Any help is really appreciated.
    Thank You.

    Please check this thread- http://forums.adobe.com/message/4263770#4263770

  • When link is opened by clicking middle button, it appears in tab toolbar;but when opened via left button (set to open in new tab) it is not shown - hidden under BACK key? I'd like left clicked tabs shown. & use mid.button for Enter.

    Windows XP; FireFox 4.0
    Would like not to have to use any keyboard shortcuts.

    No. The Tab bar is a regular toolbar in current Firefox versions, so you get the normal right-click context menu of a toolbar if you right-click the tab bar.
    You can double click on empty space on the tab bar to open a new tab if you do not want to use the new tab button.<br />
    You can drag a link on that new tab button to open that link in a new tab.<br />
    You can also drag the new tab button on another toolbar if you would like that better.<br />
    Open the Customize window via "View > Toolbars > Customize" or via "Firefox > Options > Toolbar Layout"<br />

  • How can I link two frames via a button on one of the frame?help Plz

    Ok,here is the problem. I got two fully working java frames,each has different funcion. On one of the frames(my home Frame" Frame 1" ) i got a button called "Add User", when i press it i should then get my other frame(Frame2) to popup/run. in Frame1 i got this code as action for the add user button.Note: each Frame have thier own Main class.
    public void actionPerformed (ActionEvent e)
    if (e.getSource()==jbtnAddUser)
    // new Frame2(this,"hshsh",jb);
    ////////////// The commented line is where i am not sure what to put in there, Frame1 is the name of my Frame 2 class......
    Please could anyone tell me how do i link Frame 2 to Frame 1....i appreciate it....Max

    You can create both together on pgm startup (instaniation of the class).
    Next for frame1 - I'll call it - you can setBounds(int, int, int, int) and setVisible(true); When you press the button on frame1 to get frame2, you can then do frame1.hide(), followed by frame2 setBounds and setVisible. Finally, when you are done with frame2 you can do frame2.dispose() and frame1.show(). try that.

Maybe you are looking for

  • Null check for a bind variable in view criteria

    Hi, Greetings. I am using Jdeveloper 11.1.2.0. I have a view object, LocationsView, for locations table of the XE database. I want to apply a condition, ((:bind_var is null) or (:bind_var is not null and location_id = :bind_var), in this LocationsVie

  • How to set SQL trace in OCI session ?

    Hello, In a SQL*Plus session, I can use the SQL statement "alter session set sql_trace=true;" to set SQL trace in that session only. I assume I could execute the same SQL statement from C code in an OCI client and achieve the same goal. However, if I

  • DirectShow codec required for my Video Converter

    I tried to transfer an .avi video to my V:M and it didn't let me, because the player doesn't support it, but it also says that the video converter is not able to convert it because it needs a DirectShow codec. How do I find this codec for the video c

  • CD Drive Failure

    My 2010 Macmini no longer recognizes the CD drive.  Any ideas?

  • Inter Operating Unit transactions.

    Hi All, I have some queries on the transactions between different operating units. Kindly answer the same at Individual level. 1.     I have raised a Purchase Order against a project (at distribution level) at the corporate level on behalf of a divis