Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Problem with JmenuItems Cannot setvisible true

  1. #1
    Junior Member
    Join Date
    Aug 2012
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Problem with JmenuItems Cannot setvisible true

    Hi
    I am coding an application using java and i have a menu item which i want to lead to a different form.i.e. when i click jMenuItem1 i should go to RegistrationUIMenu1. But the code i used does not work i don't understand. please help me
    Here is the code i used:
     private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {
         RegistrationUIMenu1.r1=new RegistrationUIMenu1;
         r1.setVisible(true);
        }
    I use net beans7.2 for my coding

    when i tyype the cod eit says that the variable is not found?????
    i dont understand please help me


  2. #2
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: Problem with JmenuItems Cannot setvisible true

    Without the code or error messages....

    If something is not found, that means you have not defined what ever was not found. Like saying
    i = 3;
    without saying
    int i;

  3. #3
    Junior Member
    Join Date
    Aug 2012
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Problem with JmenuItems Cannot setvisible true

    so if i declared the variable, it would work?

  4. #4
    Junior Member
    Join Date
    Aug 2012
    Posts
    13
    Thanks
    0
    Thanked 7 Times in 4 Posts

    Default Re: Problem with JmenuItems Cannot setvisible true

    HI,
    I want to insert data into a database i have made using jtextfields. i.e. When i type my name into the jtextfield1 and press jbutton1 (ok), the dtabase should get updated. How do i do this?
    Seems like you don't fully understand buttons and events. I would highly suggest you read up on some tutorials and documentation then create another (hopefully valid) attempt. After you understand your program you can move on to saving/loading data. You also want to look into why you are using mysql? Why not flat files? (Binary, txt, cfg, etc etc)

Similar Threads

  1. A true beginner needs help
    By Zsofia in forum Member Introductions
    Replies: 1
    Last Post: May 23rd, 2012, 09:45 AM
  2. My while (true) loop method only seems to run once!
    By ajfonty in forum Object Oriented Programming
    Replies: 2
    Last Post: May 18th, 2012, 07:46 PM
  3. .setVisible() troubles
    By pottsiex5 in forum AWT / Java Swing
    Replies: 2
    Last Post: October 5th, 2011, 03:28 AM
  4. Reading XML, isEndElement is never true
    By Angela in forum What's Wrong With My Code?
    Replies: 2
    Last Post: December 12th, 2010, 12:36 PM
  5. Does this still hold true?
    By April in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: February 2nd, 2010, 09:28 AM