Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

error "javax.swing.JFrame" cannot find symbol frame.getContentPane90.add

807600Oct 26 2007 — edited Oct 26 2007
Getting above errror when running the code below.how do I install the Jframe so the program can see it.Looks like JRE and JDK does not have it.


import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class SimpleGui1{

public static void main(String []args){

JFrame frame = new JFrame();
JButton button = new JButton("click me");

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

frame.getContentPane90.add(button);

frame.setSize(300,300);

frame.setVisible(true);

}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 23 2007
Added on Oct 26 2007
7 comments
2,146 views