Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<vector>

Status
Not open for further replies.

kaancho12

Technical User
Feb 22, 2005
191
0
0
test.java:11: <identifier> expected
private Vector<String> lines;
^
test.java:12: <identifier> expected
public test(Frame frame, String string, boolean modifiable, Vector<String> lines) {
^

I cant seem to define the Vector<String> --here's the snippet of the program:
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import java.util.*;
import java.lang.String;
public class test extends JDialog implements ActionListener {
private JTextArea area = new JTextArea(20, 20);
private JButton button = new JButton("O.K.");
private boolean modifiable;
private String lineSeparator = System.getProperty("line.separator");
private Vector<String> lines;
public test(Frame frame, String string, boolean modifiable, Vector<String> lines) {
super(frame, string, true);
getContentPane().add(new JScrollPane(area));
getContentPane().add(BorderLayout.SOUTH, button);
for (int index = 0; index < lines.size(); index++) {
area.append(lines.get(index) + lineSeparator);
}
this.modifiable = modifiable;
this.lines = lines;
button.addActionListener(this);
pack();
setVisible(true);
}

Any Idea?
Thanks ko12
 
Please post non-J2EE questions in the standard Java forum form269 in the future. This forum is for J2EE.

Your problem is that you are attempting to compile that code with a JDK version lower than 1.5 - you can only use that Vector syntax with JDK 1.5.

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top