Problem when displaying JFrame by button click
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 3 of 3

Thread: Problem when displaying JFrame by button click

Threaded View

  1. #1
    Join Date
    Apr 2009

    Problem when displaying JFrame by button click

    Basically, this is my problem. I have two files: and

    I'm attempting to make an instance of the NoteFrame dialog appear when I click on a button in the class.

    I have the following code in the event handler code for the button "tunerBtn" in the class:

    private void tunerBtnActionPerformed(java.awt.event.ActionEvent evt) {
    // TODO add your handling code here:

    NoteFrame newNoteFrame = new NoteFrame();


    This works, as in when I click the button, the NoteFrame dialog appears. However, the NoteFrame dialog is not set up as it is when I run the dialog directly from the NoteFrame class itself.

    Inside the 'main' function in the NoteFrame class I have included a function called 'run' which sets up all the JLabels, Text colours etc.. for the dialog. This doesnt seem to be called when the NoteFrame dialog is created by the button click in the Chords class..

    Is there any way to gain access to 'main' or 'run' through the Chords class in order to ensure the dialog is set up correctly..??

    Any help is appreciated,

    Last edited by bearchild; April 6th, 2009 at 11:18 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

This is a survey!

HTML5 Development Center