Skip to main content



      Home
Home » Newcomers » Newcomers » How to fix this?(Browser problem)
How to fix this? [message #1318874] Sun, 27 April 2014 19:20 Go to next message
Eclipse UserFriend
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The method frameHandler() is undefined for the type Browser

at Browser.main(Browser.java:21)

Here's the code

package Daniel

import java.awt.Container;
import java.awt.Font;
import java.awt.Insets;
import java.awt.TextField;

import javax.swing.JEditorPane;
import javax.swing.JFrame;
import javax.swing.JScrollPane;

public class Browser extends JFrame{

private TextField field = new TextField();
private JEditorPane display = new JEditorPane();
private JScrollPane panee = new JScrollPane(display);

public static void main(String agrs[]){

Browser file = new Browser();
file.frameHandler();
}

public void framehandler() {

setTitle("Browser");
setSize(1280, 880);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
setResizable(false);
setLayout(null);
setLocationRelativeTo(null);
addComponentsToFrame(getContentPane(();

}

public void addComponentsToFrame(Container pane){

Insets insets = getInsets();

pane.add(field);
pane.add(panee);

Font font = new Font("Menlo", Font.PLAIN, 12);

field.setFont(font);

field.setBounds(8 - insets.left, 30 - insets.top, 1268, 20);




}
}

Is there any problem with this that I can't run it?
Re: How to fix this? [message #1319148 is a reply to message #1318874] Sun, 27 April 2014 23:02 Go to previous messageGo to next message
Eclipse UserFriend
This is more of a general Java programming question than one specific to Eclipse. You'd find a wider audience at sites like javaranch.com and stackoverflow.com. In this situation, since Java is a case-sensitive language, you're trying to call #frameHandler() while you actually declared #framehandler().
Re: How to fix this? [message #1319902 is a reply to message #1319148] Mon, 28 April 2014 09:06 Go to previous message
Eclipse UserFriend
Also, you obviously didn't pay attention to the Problems or Markers views in Eclipse, which indicate when you have compilation errors or warnings.
Previous Topic:hudson build wiht parameters
Next Topic:Specifying the JVM
Goto Forum:
  


Current Time: Wed Jun 18 14:54:28 EDT 2025

Powered by FUDForum. Page generated in 0.10940 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top