Here is my code that is supposed to read a user-selected document, create text boxes from that info, and display them. (There is a lot of code in there that may not be relevent, but just ignore that.) When I compile, I receive errors that it can not find the symbols color, xIn, yIn, w, and h.
Here's my code:
import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.io.*;
public class Ex22 extends Basic {
I have the following code snipet and I get the following errors
interface expected here [javac] private class fileFilter implements FileNameExtensionFilter{ [javac] ^ cannot find symbol [javac] symbol : method fileFilter(java.lang.Object) [javac] location: class gui.components.StartupDialog
import javax.swing.*; public class opt { public int code[]; public static void main(String[] args) { int xxx = 1;
[Code] ....
Where did I did wrong cus I keep getting these errors: What do I need to do to fix the errors?
F:>javac opt.java opt.java:25: error: cannot find symbol cd.checkDeclare<zz>; ^ symbol: method checkDeclare<String> location: variable cd of type code[] java:32: error: cannot find symbol
A java program to print 10 random numbers between 512 and 1024 and then finds the smallest and biggest numbers from the list using only one loop
class BSLab4d { public static void main (String[] args){ int[] nums = new int[10]; int largest = nums[0]; int x = 0; int smallest = nums[0]; int y = 0;
I am a beginner here at JAVA and I am trying to program a Gratuity Calculator using both interface class and object class but it keeps on compiling with errors saying "cannot find symbol".I tried everything to fix it but it just keeps on stating symbol.
[CODE] public class GratuityCalculator extends JFrame { /* declarations */
// color objects Color black = new Color(0, 0, 0); Color white = new Color(255, 255, 255); Color light_gray = new Color(192, 192, 192);
So I don't know whether this is an issue with my decompiler or my IDE. I have a jar game that is written/compiled in JDK 1.1 (45.3)
Now when I use a dissasembler and export the class I want to change to a .java(source) file I can edit it fine and dandy with BlueJ. The only problem is IT WONT RECOMPILE
Now this is completely odd I thought it might be that I changed something I wasn't supposed to so I tried it again on a fresh rip of the .java file. IT STILL WONT RECOMPILE
I'm not sure exactly what the problem is, whether the .class is getting truncated/changed when exported to .java OR whether my decompiler is funky... But it makes absolutely no sense that you can decompile an already existing .class file RECOMPILE it exactly UNCHANGED and it fails to recompile....
I only want to change a few lines so that the jar im using can use a touchscreen...
I have been on java applets and it's been fun but I'm stucked with painting a ladybug image on applet using "getImage ( getCodeBase(), "Images/ ladybug.gif") to load the image. It runs but the appletviewer is blank. My applets are not embedded in the web. I just type the codes in eclipse and click the 'run' button.I think the problem is that java is not finding the image in the directory I specified. Please where am I supposed to save the ladybug image so that java can find it on my system whenever I supply the path.
I am having trouble figuring out why java is giving me an error for the symbols. I will post the errors below the code.
Java Code: import java.util.Scanner; public class ShelbyHarms_3_02 { public static void main(String[] args) { Scanner console = new Scanner(System.in);
I want to use graphs in java. Is there any class in java for implementation of graph theory? I most create a graph and run DFS(Depth First Search) algorithm on that.
I am receiving two errors that I'm not sure how to fix. The first is illegal start of expression at line
"public void actionPerformed(ActionEvent e)"
and no suitable method found for intersect JButton at line
"if(blocker01.getBounds().intersects(r_wall))" .
import java.awt.*; import javax.swing.*; import java.awt.event.*; public class gamePanel01 extends JPanel implements KeyListener { character ch1 = new character("Hero");
public test5 { public boolean test(int grille[][]){ for (int i = 0 || i < grille.length || i++){ int max = grille[i][0]; for (int e = 1 || e < grille[i].length || j++){ if (grille[i][e]== max && max !=0){ solution = false; System.exit(1);
I get quite a few errors while trying to compile the BeerSong from the Head First Java book. I copied the text from another person that did the beer song on this forum and it worked as expected. What I can't figure out is why mine is not working when it looks like the text is exactly the same between the two versions. His works, but mine doesn't.
Here is the text and errors that I get:
public class BeerSong { public static void main (String[] args) { int beerNum = 99; String word = "bottles";
I am making a simple mod/hack for a game programmed in Java. I located the .class file I needed and deobfuscated it and then decompiled it. After that I went in and made a very simple adjustment that I wanted to make. Unfortunately I can across a problem when trying to compile the file! The file won't compile because there are errors. The reason there are errors is because this is just one file out of an entire game. I know this my seem weird, but is there some way I can compile the file with the errors.
I'm trying to use a setter method to pick a random integer to be the MPG for a car. However, I'm having major issues in my driver when trying to use that random number in an instance. I'm not finished with the driver yet because I keep getting "cannot find symbol errors"
import java.util.Random; public class Car { private String make; private String model; private int year; private int mpg; private int odometer; Random generator = new Random();
I am watching BrandonioProductions on youtube. His videos are pretty good, but he doesn't seem to get errors where I get them. Here is an example.
public class compareUnequal { public static void main(String[] args){ compareTwo(); } public static void compareTwo(){ String x = "david"; String y = "Notdavid"; if (!x.equals(y)){ System.out.println("Not equal"); } } }
It runs ok, but asked me to proceed when there is an error, but I can`t figure out where the error is!
I'm trying to read lines from a textfile and count all the words using String Tokenizer. However I keep getting an error "Unhandled exception type FileNotFoundException" on my IDE(Eclipse) referring to lines 13 and 8. When I let the IDE automatically, and I've even tried typing this manually, insert a try-catch block more errors show up concerning inputFile. When I insert the throws FileNotFoundException for each method it compiles but after running it gives me a FileNotFoundException for textfile.txt. What's even more interesting is that when I copy the .java file out of the IDE project folder, place it in a random empty folder on the Desktop with the textfile.txt, and try running it through command line, it gives a NoSuchElementException: No line found.
I have a JSP which will let a user register for an account at my website. If the user submits wrong or illegal info into the JSP, then I want to return the same JSP with an appropriate error message next to/above each wrongly filled (form) fields.
If possible, highlight the wrongly filled form field - this feature is not necessary though.
I have given a sample below to show what I need. I understand that the sample must be using something like javascript, but I don't know all that client side scripting. I only want to use JSP to do it. As I said, I want to sort of return the JSP form to the user after marking all the mistakes and how to correct them.
for my assignment I am to only add the sort and total inventory methods in the inventory class. And not create an array in the inventory class at all. My inventory class should contain all the variables needed to use with the two new methods: sort and calculate total inventory.By not creating any array in the inventory class and not touching the variables at all.For the inventoryTest class, I only need to declare an array of the inventory class by making an instance of the inventory.
public class inventory {
private int prodNumber; // product number private String prodName; // product name private int unitsTotal; // total units in stock private double unitPrice; // price per unit private double totalInventory; // amount of total inventory
I have to build the attached GUI as exercise (exercise.jpg), but I am getting a lot of errors on the console. OK so the code is available on pastebin here: URL>...An excerpt of errors is attached. I don't understand why I get them. Basically the compiler is picking on new GridBagCostraints() and new Insets().
I need to convert infix To Postfix but have a few errors.
Error msg:
PostFix: Exception in thread "main" java.util.EmptyStackException at java.util.Stack.peek(Unknown Source) at java.util.Stack.pop(Unknown Source) at assignment4.infixToPostfix.evaluatePostfix(infixTo Postfix.java:129) at assignment4.infixToPostfix.main(infixToPostfix.jav a:19)
NB: 129 >>return (double) s1.pop(); AND 19>>>double ans = evaluatePostfix(postfixStr); Deadline = less than 1 hour
public void init(Board board) { JPanel Panel = new JPanel(); Panel.setLayout(new GridLayout(board.getWidth(), board.getHeight())); getContentPane().add(Panel, BorderLayout.CENTER); Panel.setBorder(new LineBorder(Color.BLACK)); // it does not work also
[code]....
I have a JFrame. I added two JPanels to the JFrame. The first one is GridLayout and it should be situated at CENTER. Another one is bottomPanel, and that one should be situated at SOUTH.I would like to add two new JPanels(kit and another one) to the bottomPanel.Compiler does not show any warning or errors.The problem is, that bottomPanel situates at NORTH, not at SOUTH. kit situates at CENTER of bottomPanel, not at WEST.
public class Person { protected static int MAX_AGE = 150; protected static int MIN_AGE = 0; private static final String VALID_WORD_REGEXP = "[a-zA-Z]{3,30}"; private String firstName; private String lastName;
[Code] ....
I'm trying to learn right way how to throw exceptions. I
Besides that I have couple questions:
I can't quite understand throws statement. I'm thinking throws statement is for passing exceptions one level higher(with are not cought in this caller function). So that would mean I need to put throws in this function only:
Java Code: Person(String firstName, String lastName, int age) mh_sh_highlight_all('java');
Am I right or wrong and is there any other use for it? If so that would mean when
Java Code: Person person = new Person(.....) mh_sh_highlight_all('java');
protected void randomise() { int[] copy = new int[]; // used to indicate if elements have been used boolean[] used = new boolean[array().length]; Arrays.fill(used,false); for (int index = 0; index < array().length {