Java Error Resource

Tagged:  

If you are a Java developer then you are probably always looking for good resources to correct errors. If you are like me you spend a lot of time using "the worlds greatest debugger" (a.k.a. Google), but it would be good to have an additional good resource that focused on Java errors.

Well, over at idError they have put together a large collection of Java errors and solutions to the errors. Currently, the site focuses on Java, Weblogic and Oracle related errors and more errors and solutions are added all of the time.

Below is what they say about the site.

This site has been started by a group of professional IT consultants with the scope of providing a very simple and fast platform to find Solutions for most of the Java related errors and problems.

The site is absolutely free, and we hope to maintain this for the years to come…

We depend on YOU to submit high quality solutions, but please note that we will review and edit the solutions in order to maintain a consistent quality.

The main question people are asking about this site is WHY they should use it when there are so many other web sites that deal with errors and solutions: most of the solutions presented on this site have been edited it by experienced programmers so you are more likely to find the correct solution to your error on this site, than on any other similar sites!

Please don’t forget to support the site by submitting solutions or comments to the already posted solutions. With your help we hope to establish a new standard of content quality for a FREE web site.

You can go directly to the site here.

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

public class WarGame extends JFrame implements ActionListener {
/*
public void ActionPerformed(java.awt.event.ActionEvent JB ){
// expected line 7
}
google googooglegooglegooglegooglegooglegoooglegooglegooglegooglegooglegooglegooglegoogle
public void ActionPerformed(ActionEvent JA) {

String buttonPushed = JA.getActionCommand();
System.out.println(buttonPushed);

buttonPushed.addActionListiner(this);
}*/

public static void main (String[]args){
WarGame frame = new WarGame();
WarGame example = new WarGame();
Deck fullDeck = new Deck();

String[] names = new String[13];
int[] values = new int[13];
String[] suits = new String[4];
names[0] = "Two";
names[1] = "Three";
names[2] = "Four";
names[3] = "Five";
names[4] = " Six";
names[5] = "Seven";
names[6] = "Eight";
names[7] = " Nine";
names[8] = " Ten ";
names[9] = " Jack";
names[10] = " Queen";
names[11] = " King";
names[12] = "Ace";
values[0] = 2;
values[1] = 3;
values[2] = 4;
values[3] = 5;
values[4] = 6;
values[5] = 7;
values[6] = 8;
values[8] = 10;
values[9] = 11;
values[10] = 12;
values[11] = 13;
values[12] = 14;
suits[0] = "Hearts";
suits[1] = "Diamonds";
suits[2] = "Clubs";
suits[3] = "Spades";
for (int i = 0; i < suits.length; i++) {
for (int j = 0; j < values.length; j++) {

Card beingBuilt;
beingBuilt = new Card(suits[i],values[j],names[j], names[j] +"%20of%20" + suits[i]+".gif" );

fullDeck.addCard(beingBuilt);
}
}
}

/*cardNeeded = new card();
cardNeeded.setActionCommand();
cardNeeded.setActionCommand("I need a card");

player p1 = new player();
player p2 = new player();
}
public void actionPerformed(actionEvent e){
}
public void actionPerformed(ActionEvent evt) {

if (action.equals(presed)) ;
myButton.setIcon(yourPic);

repaint();
}*/

JPanel row1 = new JPanel();
JLabel fullNameOne = new JLabel("Fullname", JLabel.RIGHT);
JLabel fullNameTwo = new JLabel("FullName", JLabel.LEFT);
JPanel row2 = new JPanel();

// ***8added
ImageIcon fix = new ImageIcon("bills.gif");
JButton fixButton = new JButton(fix);
JLabel cardOne = new JLabel("Your Card is : ", JLabel.LEFT);
ImageIcon myExampleOne = new ImageIcon("M:/JAVA/CardGame/Cards/Ace%20of%20Diamonds.gif");
JButton buttonWithOne= new JButton( myExampleOne);
JLabel cardTwo = new JLabel("Your Card is : ", JLabel.LEFT);

ImageIcon myExampleTwo = new ImageIcon("Four%20of%20Diamonds.gif");
JButton buttonWithTwo = new JButton(myExampleTwo);

JTextField trial = new JTextField();
JLabel winnersLabel = new JLabel("Winners: ", JLabel.RIGHT);
//java.net.URL.example = new URL ("http://www.cs.wustl.edu/~cytron/cs101/Labs/7a/Given/cards/Jack%20of%20Spades.gif");

JPanel row3 = new JPanel();
JLabel cardFive= new JLabel("Your Card is : ", JLabel.RIGHT);
ImageIcon myExampleFive = new ImageIcon("picture.gif");

JButton buttonWithFive = new JButton(myExampleFive);
JLabel cardSix = new JLabel("Your Card is : ", JLabel.LEFT);
ImageIcon myExampleSix = new ImageIcon("picture.gif");
JButton buttonWithSix = new JButton(myExampleSix);
JLabel cardSeven = new JLabel("Your Card is : ", JLabel.RIGHT);
ImageIcon myExampleSeven = new ImageIcon("picture.gif");
JButton buttonWithSeven = new JButton(myExampleSeven);

public WarGame (){

super("War Game");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// GridLayout layout = new GridLayout(5, 1, 10, 10);
BorderLayout border = new BorderLayout();
Container pane = getContentPane();
// pane.setLayout(layout);
pane.setLayout(border);
FlowLayout layout1 = new FlowLayout(FlowLayout.CENTER,
10, 10);
add(fullNameOne);
add(fullNameTwo);
row1.setLayout(layout1);

// row1.add(buttonWithOne);

// Undo next 2 lines
//row1.add(buttonWithOne);
// row1.add(fullNameTwo);

// pane.add(row1);
// dingee pane.add(row1,BorderLayout.NORTH);
pane.add(row1,BorderLayout.CENTER);
GridLayout layout2 = new GridLayout(2,4, 5, 5);
row2.setLayout(layout2);
// row2.setLayout(layout2);
// row2.setLayout(layout2);
// row2.setLayout(layout2);
row2.add(cardOne);
row2.add(cardTwo);
// row2.add(cardThree);
// row2.add(picFour);

/*for (int i = 0; i < 6; i++) {
numbers[i] = new JTextField();
row2.add(numbers[i]);
}
row2.add(winnersLabel);

winners[i] = new JTextField();
winners[i].setEditable(false);
row2.add(winners[i]);
*/

//pane.add(row2);
pane.add(row2,BorderLayout.EAST);

GridLayout layout3 = new GridLayout(2,4, 5, 5);
row3.setLayout(layout3);
// row3.setLayout(layout3);
// row3.setLayout(layout3);
// row3.setLayout(layout3);
row3.add(cardFive);
row3.add(cardSix);
///row3.add(cardSeven);
/// row3.add(cardEight);
///pane.add(row3);
pane.add(row3,BorderLayout.WEST);

public void ActionPerformed(ActionEvent JA) {// illegal start of expression

String buttonPushed = JA.getActionCommand();
System.out.println(buttonPushed);

}
setContentPane(pane);// invalid method declaration; return type required, expected
setVisible(true); //invalid method declaration; return type required, illegal start of type

public static void main (String[]args){
WarGame frame = new WarGame();
WarGame example = new WarGame();
Deck fullDeck = new Deck();
}
}
}//class, interface, or enum expected

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

public class WarGame extends JFrame implements ActionListener {
/*
public void ActionPerformed(java.awt.event.ActionEvent JB ){
// expected line 7
}
google googooglegooglegooglegooglegooglegoooglegooglegooglegooglegooglegooglegooglegoogle
public void ActionPerformed(ActionEvent JA) {

String buttonPushed = JA.getActionCommand();
System.out.println(buttonPushed);

buttonPushed.addActionListiner(this);
}*/

public static void main (String[]args){
WarGame frame = new WarGame();
WarGame example = new WarGame();
Deck fullDeck = new Deck();

String[] names = new String[13];
int[] values = new int[13];
String[] suits = new String[4];
names[0] = "Two";
names[1] = "Three";
names[2] = "Four";
names[3] = "Five";
names[4] = " Six";
names[5] = "Seven";
names[6] = "Eight";
names[7] = " Nine";
names[8] = " Ten ";
names[9] = " Jack";
names[10] = " Queen";
names[11] = " King";
names[12] = "Ace";
values[0] = 2;
values[1] = 3;
values[2] = 4;
values[3] = 5;
values[4] = 6;
values[5] = 7;
values[6] = 8;
values[8] = 10;
values[9] = 11;
values[10] = 12;
values[11] = 13;
values[12] = 14;
suits[0] = "Hearts";
suits[1] = "Diamonds";
suits[2] = "Clubs";
suits[3] = "Spades";
for (int i = 0; i < suits.length; i++) {
for (int j = 0; j < values.length; j++) {

Card beingBuilt;
beingBuilt = new Card(suits[i],values[j],names[j], names[j] +"%20of%20" + suits[i]+".gif" );

fullDeck.addCard(beingBuilt);
}
}
}

/*cardNeeded = new card();
cardNeeded.setActionCommand();
cardNeeded.setActionCommand("I need a card");

player p1 = new player();
player p2 = new player();
}
public void actionPerformed(actionEvent e){
}
public void actionPerformed(ActionEvent evt) {

if (action.equals(presed)) ;
myButton.setIcon(yourPic);

repaint();
}*/

JPanel row1 = new JPanel();
JLabel fullNameOne = new JLabel("Fullname", JLabel.RIGHT);
JLabel fullNameTwo = new JLabel("FullName", JLabel.LEFT);
JPanel row2 = new JPanel();

// ***8added
ImageIcon fix = new ImageIcon("bills.gif");
JButton fixButton = new JButton(fix);
JLabel cardOne = new JLabel("Your Card is : ", JLabel.LEFT);
ImageIcon myExampleOne = new ImageIcon("M:/JAVA/CardGame/Cards/Ace%20of%20Diamonds.gif");
JButton buttonWithOne= new JButton( myExampleOne);
JLabel cardTwo = new JLabel("Your Card is : ", JLabel.LEFT);

ImageIcon myExampleTwo = new ImageIcon("Four%20of%20Diamonds.gif");
JButton buttonWithTwo = new JButton(myExampleTwo);

JTextField trial = new JTextField();
JLabel winnersLabel = new JLabel("Winners: ", JLabel.RIGHT);
//java.net.URL.example = new URL ("http://www.cs.wustl.edu/~cytron/cs101/Labs/7a/Given/cards/Jack%20of%20Spades.gif");

JPanel row3 = new JPanel();
JLabel cardFive= new JLabel("Your Card is : ", JLabel.RIGHT);
ImageIcon myExampleFive = new ImageIcon("picture.gif");

JButton buttonWithFive = new JButton(myExampleFive);
JLabel cardSix = new JLabel("Your Card is : ", JLabel.LEFT);
ImageIcon myExampleSix = new ImageIcon("picture.gif");
JButton buttonWithSix = new JButton(myExampleSix);
JLabel cardSeven = new JLabel("Your Card is : ", JLabel.RIGHT);
ImageIcon myExampleSeven = new ImageIcon("picture.gif");
JButton buttonWithSeven = new JButton(myExampleSeven);

public WarGame (){

super("War Game");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// GridLayout layout = new GridLayout(5, 1, 10, 10);
BorderLayout border = new BorderLayout();
Container pane = getContentPane();
// pane.setLayout(layout);
pane.setLayout(border);
FlowLayout layout1 = new FlowLayout(FlowLayout.CENTER,
10, 10);
add(fullNameOne);
add(fullNameTwo);
row1.setLayout(layout1);

// row1.add(buttonWithOne);

// Undo next 2 lines
//row1.add(buttonWithOne);
// row1.add(fullNameTwo);

// pane.add(row1);
// dingee pane.add(row1,BorderLayout.NORTH);
pane.add(row1,BorderLayout.CENTER);
GridLayout layout2 = new GridLayout(2,4, 5, 5);
row2.setLayout(layout2);
// row2.setLayout(layout2);
// row2.setLayout(layout2);
// row2.setLayout(layout2);
row2.add(cardOne);
row2.add(cardTwo);
// row2.add(cardThree);
// row2.add(picFour);

/*for (int i = 0; i < 6; i++) {
numbers[i] = new JTextField();
row2.add(numbers[i]);
}
row2.add(winnersLabel);

winners[i] = new JTextField();
winners[i].setEditable(false);
row2.add(winners[i]);
*/

//pane.add(row2);
pane.add(row2,BorderLayout.EAST);

GridLayout layout3 = new GridLayout(2,4, 5, 5);
row3.setLayout(layout3);
// row3.setLayout(layout3);
// row3.setLayout(layout3);
// row3.setLayout(layout3);
row3.add(cardFive);
row3.add(cardSix);
///row3.add(cardSeven);
/// row3.add(cardEight);
///pane.add(row3);
pane.add(row3,BorderLayout.WEST);

public void ActionPerformed(ActionEvent JA) {// illegal start of expression

String buttonPushed = JA.getActionCommand();
System.out.println(buttonPushed);

}
setContentPane(pane);// invalid method declaration; return type required, expected
setVisible(true); //invalid method declaration; return type required, illegal start of type

public static void main (String[]args){
WarGame frame = new WarGame();
WarGame example = new WarGame();
Deck fullDeck = new Deck();
}
}
}//class, interface, or enum expected

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre> <div> <blockquote> <object> <embed> <img> <param>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Copy the characters (respecting upper/lower case) from the image.