Here you say that frame is an instance of the JFrame class, and that it should be visible (line 26). Eclipse is warning youįor this, that's why you see a red circle on the left and a red line under your text. Well, it can't find it there, so that's why you get this error report. So, what Java tries to do now, is to look up the method "SetDefaultCloseOperation" in the definition of Your class MainFrame starts with the following line:įor Java, that means you are creating a subclass of the class Object. ![]() Yes, I consider it to be the biggest advantage of using IDE's like Eclipse and NetBeans: they show you theseĮrrors at typing time, instead of at compiling time (but some people around here "might" be of different The method setSize(int, int) is undefined for the type MainFrameĪt (MainFrame.java:27) Syntax error, insert " " to complete Statement The method setBounds(int, int, int, int) is undefined for the type MainFrame The method setTitle(String) is undefined for the type MainFrame The method setDefaultCloseOperation(int) is undefined for the type MainFrame SetTitle("That new new NEW contact book") Įxception in thread "main" : Unresolved compilation problems: Here is my code, fallowed by the stack trace. This code works, but when I try to add panels and buttons it doesn't, what about inheritance, creating objects/classes/methods/constructors/polymorphism, final keyword this keyword and extends/abstract and final classes and variable types do I need to know about in order to successfully program a gui? Here's a print screen image, direct link is -> I could probably use this as a "send a comment to the administrator" on a website or something like that. ![]() ![]() I've been trying to create gui's in java for days now but I keep running into problems, a lot of the methods get underlined with a red line because apparently there are some type of error, the problem is I'm not really sure what the error means so I took a pic of it, the goal here is to create a contact book, but first I'm going to try to do something easy and that is to create a simple frame that has a text field that allows you to enter your name and email address, has a check box that ask the user if they want there name to be revealed when the email is sent and when you hit the send button it sends a message to the email you entered.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |