hvorfor kan det ikke kører i Forte?
package DiveLog;import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class DiveLog2 {
private JTabbedPane tabbedPane;
private JFrame dlframe;
/** Creates new DiveLog2 */
public DiveLog2() {
dlframe = new JFrame("A Java(TM) Tecnology Dive Log");
dlframe.addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
System.exit(0);
}
});
tabbedPane = new JTabbedPane(SwingConstants.LEFT);
tabbedPane.setBackground(java.awt.Color.blue);
tabbedPane.setForeground(java.awt.Color.white);
populateTabbedPane();
buildMenu();
dlframe.getContentPane().add(tabbedPane);
dlframe.pack();
dlframe.setSize(765,690);
dlframe.setBackground(Color.white);
dlframe.setVisible(true);
}
private void populateTabbedPane(){
tabbedPane.addTab("Welcome",null,new Welcome(),"Welcome to the Dive Log");
tabbedPane.addTab("Diver Data",null,new Diver(),"Click here to enter diver data");
tabbedPane.addTab("Log Dives",null,new Dives(),"Click here to enter dives");
tabbedPane.addTab("Statistics",null,new Statistics(),"Click here to calculate dive Statistics");
tabbedPane.addTab("Favorite Web Site",null,new Website(),"Click here to see a web site");
tabbedPane.addTab("Resources",
null,
new Resources (),
"Click here to see a list of Resources ");
}
private void buildMenu(){
JMenuBar mb = new JMenuBar();
JMenu menu = new JMenu("File");
JMenuItem item = new JMenuItem("Exit");
item.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
System.exit(0);
}
});
menu.add(item);
mb.add(menu);
dlframe.setJMenuBar(mb);
}
public static void main(String[] args) {
DiveLog dl = new DiveLog();
}
}
her er fejlene:
DiveLog/DiveLog2.java [44:1] cannot resolve symbol
symbol : method addTab (java.lang.String,<null>,DiveLog.Welcome,java.lang.String)
location: class javax.swing.JTabbedPane
tabbedPane.addTab("Welcome",null,new Welcome(),"Welcome to the Dive Log");
^
DiveLog/DiveLog2.java [45:1] cannot resolve symbol
symbol : method addTab (java.lang.String,<null>,DiveLog.Diver,java.lang.String)
location: class javax.swing.JTabbedPane
tabbedPane.addTab("Diver Data",null,new Diver(),"Click here to enter diver data");
^
DiveLog/DiveLog2.java [46:1] cannot resolve symbol
symbol : method addTab (java.lang.String,<null>,DiveLog.Dives,java.lang.String)
location: class javax.swing.JTabbedPane
tabbedPane.addTab("Log Dives",null,new Dives(),"Click here to enter dives");
^
DiveLog/DiveLog2.java [47:1] cannot resolve symbol
symbol : method addTab (java.lang.String,<null>,DiveLog.Statistics,java.lang.String)
location: class javax.swing.JTabbedPane
tabbedPane.addTab("Statistics",null,new Statistics(),"Click here to calculate dive Statistics");
^
DiveLog/DiveLog2.java [48:1] cannot resolve symbol
symbol : method addTab (java.lang.String,<null>,DiveLog.Website,java.lang.String)
location: class javax.swing.JTabbedPane
tabbedPane.addTab("Favorite Web Site",null,new Website(),"Click here to see a web site");
^
DiveLog/DiveLog2.java [49:1] cannot resolve symbol
symbol : method addTab (java.lang.String,<null>,DiveLog.Resources,java.lang.String)
location: class javax.swing.JTabbedPane
tabbedPane.addTab("Resources",
^
DiveLog/DiveLog.java [83:1] <identifier> expected
menu.add(item);
^
DiveLog/DiveLog.java [84:1] <identifier> expected
mb.add(menu);
^
DiveLog/DiveLog.java [85:1] <identifier> expected
jInternalFrame1.setJMenuBar(mb);
^
DiveLog/DiveLog.java [91:1] illegal start of expression
private void exitForm(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_exitForm
^
DiveLog/DiveLog.java [105:1] illegal start of expression
private javax.swing.JTabbedPane jTabbedPane1;
^
DiveLog/DiveLog.java [40:1] cannot resolve symbol
symbol : variable jInternalFrame1
location: class DiveLog.DiveLog
jInternalFrame1 = new javax.swing.JInternalFrame();
^
DiveLog/DiveLog.java [41:1] cannot resolve symbol
symbol : variable jTabbedPane1
location: class DiveLog.DiveLog
jTabbedPane1 = new javax.swing.JTabbedPane();
^
DiveLog/DiveLog.java [45:1] cannot resolve symbol
symbol: method exitForm (java.awt.event.WindowEvent)
exitForm(evt);
^
DiveLog/DiveLog.java [49:1] cannot resolve symbol
symbol : variable jInternalFrame1
location: class DiveLog.DiveLog
jInternalFrame1.setBackground(java.awt.Color.white);
^
DiveLog/DiveLog.java [50:1] cannot resolve symbol
symbol : variable jInternalFrame1
location: class DiveLog.DiveLog
jInternalFrame1.setVisible(true);
^
DiveLog/DiveLog.java [52:1] cannot resolve symbol
symbol : variable jInternalFrame1
location: class DiveLog.DiveLog
jInternalFrame1.setSelected(false);
^
DiveLog/DiveLog.java [56:1] cannot resolve symbol
symbol : variable jInternalFrame1
location: class DiveLog.DiveLog
add(jInternalFrame1, java.awt.BorderLayout.EAST);
^
DiveLog/DiveLog.java [58:1] cannot resolve symbol
symbol : variable jTabbedPane1
location: class DiveLog.DiveLog
jTabbedPane1.setToolTipText("");
^
DiveLog/DiveLog.java [59:1] cannot resolve symbol
symbol : variable jTabbedPane1
location: class DiveLog.DiveLog
add(jTabbedPane1, java.awt.BorderLayout.WEST);
^
DiveLog/DiveLog.java [65:1] cannot resolve symbol
symbol : variable jTabbedPane1
location: class DiveLog.DiveLog
jTabbedPane1.addTab("Welcome",null,new Welcome(),"Welcome to the Dive Log");
^
DiveLog/DiveLog.java [66:1] cannot resolve symbol
symbol : variable jTabbedPane1
location: class DiveLog.DiveLog
jTabbedPane1.addTab("Diver Data",null,new Diver(),"Click here to enter diver data");
^
DiveLog/DiveLog.java [67:1] cannot resolve symbol
symbol : variable jTabbedPane1
location: class DiveLog.DiveLog
jTabbedPane1.addTab("Log Dives",null,new Dives(),"Click here to enter dives");
^
DiveLog/DiveLog.java [68:1] cannot resolve symbol
symbol : variable jTabbedPane1
location: class DiveLog.DiveLog
jTabbedPane1.addTab("Statistics",null,new Statistics(),"Click here to calculate dive Statistics");
^
DiveLog/DiveLog.java [69:1] cannot resolve symbol
symbol : variable jTabbedPane1
location: class DiveLog.DiveLog
jTabbedPane1.addTab("Favorite Web Site",null,new Website(),"Click here to see a web site");
^
DiveLog/DiveLog.java [70:1] cannot resolve symbol
symbol : variable jTabbedPane1
location: class DiveLog.DiveLog
jTabbedPane1.addTab("Resources",null,new Resources (),"Click here to see a list of Resources ");
^
DiveLog/DiveLog.java [83:1] cannot resolve symbol
symbol : class add
location: package menu
menu.add(item);
^
DiveLog/DiveLog.java [84:1] cannot resolve symbol
symbol : class add
location: package mb
mb.add(menu);
^
DiveLog/DiveLog.java [85:1] cannot resolve symbol
symbol : class setJMenuBar
location: package jInternalFrame1
jInternalFrame1.setJMenuBar(mb);
^
DiveLog/DiveLog.java [77:1] cannot resolve symbol
symbol : method actionListener (<anonymous java.awt.event.ActionListener>)
location: class javax.swing.JMenuItem
item.actionListener(new ActionListener()
^
DiveLog/DiveLog.java [107:1] cannot resolve symbol
symbol : variable jTabbedPane1
location: class DiveLog.DiveLog
jInternalFrame1.getContentPane().add(jTabbedPane1);
^
DiveLog/DiveLog.java [107:1] cannot resolve symbol
symbol : variable jInternalFrame1
location: class DiveLog.DiveLog
jInternalFrame1.getContentPane().add(jTabbedPane1);
^
32 errors
Errors compiling DiveLog2.
den metode addTab findes i forte , men jeg for fejl selvom jeg har gjort hvad kunne
