1,963 Posted Topics

Member Avatar for i_me_roo

[QUOTE=JRabbit2307;1008024]hi everyone i'm new to programming and i have to say its fun and frustrating at the same time could anyone help me fix this?? [/QUOTE] This is a 5 year old thread. That were you thinking posting here? Do you random peek threads and start writing irrelevant things in …

Member Avatar for jon.kiparsky
0
951
Member Avatar for luisator

We need to see more code. Post your classes. We need to see how they are declared, which are abstract and how you override your abstract methods. And [I]niksinghania[/I] the error clearly says that the problem is the enableRecording method (cannot resolve symbol) not how the Boolean object is created. …

Member Avatar for Ezzaral
0
170
Member Avatar for annttiigs

You can try to use this encoding: ISO-8859-9 taken from: [URL="http://www.w3schools.com/tags/ref_charactersets.asp"]http://www.w3schools.com/tags/ref_charactersets.asp[/URL] If it doesn't work you can try to change the encoding of the page at the browser if you go at at the "View" menu. Or investigate that link for more ideas

Member Avatar for javaAddict
0
411
Member Avatar for PhiberOptik

I have NetBeans that makes it very easy to create a GUI. But still there are times where I still write my GUI from scratch. Opening the text editor and writing the code. In that way you will learn what is the difference between a JPanel and a JFrame and …

Member Avatar for mjason
0
214
Member Avatar for Gheter

[QUOTE=Akill10;1470485]No.[/QUOTE] That is not the right answer [I]Akill10[/I], shame on you. You should have said: Noooooo! Anyway, when you signed in this forum, you agreed to the terms, and those terms say that we don't give away homework nor any code. Show some effort, post your code and ask specific …

Member Avatar for javanoob101
-1
215
Member Avatar for jake1496
Member Avatar for aman rathi

Is this the exact code that you use? Because string needs capital S and system, needs capital S: [CODE] class forloop { public static void main(String args[]){ int x; for(x=0;x<10;x=x+1) System.out.println("this is x:"+x); } } [/CODE] How do you compile the .java file? Also for future references, you should name …

Member Avatar for aman rathi
0
179
Member Avatar for -acir-

Here is an example of how to create a simple menu. You can put that in a method and call it. You can have different menus in different methods. And you can have those methods called from another menu-method: [CODE] void menu_1 () { int choice = 0; while (true) …

Member Avatar for -acir-
0
886
Member Avatar for sandman89

Query the data and put them in objects. Then use those objects to create the JTree. The above must be independent. One class for reading and returning the data. Then call that class take the data form the DB and build your tree.

Member Avatar for javaAddict
0
49
Member Avatar for kirankumargali

The way I see it the assignment IS the instructions! It is not like that you have been given only this: [B]>>>>[/B] ITU wants you write some classes for their Personnel Record System. To make it simple, consider only 4 classes: Person, Employee, Instructor and Student. The following figure illustrates …

Member Avatar for javaAddict
-4
538
Member Avatar for Progr4mmer

Have you tried reading the error? The problem is when you run your code. Read the errors that you get: [QUOTE] Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at OurGame.Board.checkCollisions(Board.java:78) [/QUOTE] At the file: Board.java line 78, in the method checkCollisions you are trying to use an object which is null. (java.lang.NullPointerException) …

Member Avatar for Progr4mmer
0
107
Member Avatar for zach&kody

Actually, I think, that "import a method" is just a fancy way of saying, I want to call a method of a class from somewhere else: [CODE] class MyUtils { public MyUtils() { } public static void method_1() { // ........ } public void method_2() { // ........ } } …

Member Avatar for zach&kody
0
6K
Member Avatar for isamuhunter

What errors do you get? What is the output and why you thing it is wrong. Also I don't see where is the method for putting the data from one array to the other. Maybe you should loop one array and put its values to another, but the 0 index …

Member Avatar for javaAddict
0
183
Member Avatar for EmbeddedHelp

First of all. You open the connection and immediately you close. The finally always gets executed. So when you open it at the beginning of your program you go and close it. At the method processResults you declare another Connection object. It is not the same as the one in …

Member Avatar for javaAddict
0
189
Member Avatar for atticusMom

In the Item constructor when you do this: [ICODE]description = description;[/ICODE] You are not initializing the attributes of the class. The description is the same as the one of the argument because it is declared locally as an argument. You need this: [ICODE]this.description = description;[/ICODE] With "this" you say put …

Member Avatar for atticusMom
1
5K
Member Avatar for kukuruku

In the same way you access any element in any array: [CODE] // initializing the ARRAY: MyCustomClass [] array = new MyCustomClass[2]; // array is not null, but array[0], array[1] are null // array[0] is a MyCustomClass array[0] = new MyCustomClass(....); array[1] = new MyCustomClass(....); // array[i] are now created …

Member Avatar for javaAddict
0
172
Member Avatar for sudiyer

[QUOTE=sudiyer;1471009]hi .. i am new to jsp coding - i hav created a database using mysql workbench - it is a Graphical Interface to creating databases and tables... but the problem is that i dont know how to access my tables through jsp coding .. where should i put my …

Member Avatar for peter_budo
0
291
Member Avatar for Oblivious21

[QUOTE=Oblivious21;1468291]Ok so i fixed the error by adding a try and catch statement and it works great !!! [CODE] int[] shapeArray; // declare an in array shapeArray = new int[rows]; // new array with size rows try { for (int j = 1; j <= rows; j++) { System.out.print("Please enter …

Member Avatar for Oblivious21
0
163
Member Avatar for coco24

You need to provide more information as what are those variables that you have? Do you have an array and you want to see how many times the argument is inside the array? Then loop the array and take each element of the array and compare it with the argument

Member Avatar for javaAddict
0
80
Member Avatar for yukikazemedia

I would advise you to change the choices method, because I am sorry, but it is totally wrong. You might not see it, it might never happen but, an OutOfMemoryException is about to happen. You keep on calling the choices inside the choices method. That gives you the behavior you …

Member Avatar for javaAddict
0
189
Member Avatar for Phatsimo Mosiam

Use code tags. And the error says: line 5. How are we suppose to know which is line 5 the way you posted. Try next time to show where that line is. Press the button (code) when you create a post and put your code inside. Also the problem is: …

Member Avatar for javaAddict
0
107
Member Avatar for churva_churva
Re: GUI

Inside the constructor, create the JLabel with the image and add it to the component. You might want to look at the API of JLabel. For adding elements to a frame check some tutorials. I usually do this in the constructor: [CODE] private JPanel panel = new JPanel(); public MainFrame() …

Member Avatar for churva_churva
0
159
Member Avatar for JavaHelpNeed

[QUOTE=JavaHelpNeed;1452905]Calculate Love Percentege . Between two names[/QUOTE] The algorithm is in the c++ program that you copied and posted here. You can read it from there.

Member Avatar for javaAddict
0
305
Member Avatar for rhoxart faye

[QUOTE=rhoxart faye;1465201]help me..how to print a sum and average of grades using Java?[/QUOTE] Start a new thread with your question and your code. Don't expect anyone to do your homework. You should use a for loop

Member Avatar for peter_budo
-1
461
Member Avatar for jips11in

[QUOTE=-ordi-;1065213][CODE]public class Algarv { public static void main(String args[]) { int numbrid = 0; // Proovime kohe algusest int loendur = 0; // Loendame üles, et pärast lihtsam oleks while(loendur < 100) // Eelkontrolliga, t2idame kuni see on 100 { numbrid++; if(numbrid % 2 != 0) { int abi = …

Member Avatar for masijade
0
160
Member Avatar for EmbeddedHelp

You will need a while loop. The last for loop will not be inside that while. You will have the while and will not exit unless a correct name is entered. If it does then exit: [CODE] int Index = -1; String locate = ""; // so that you will …

Member Avatar for javaAddict
0
158
Member Avatar for KKR_WE_RULE

You have declare the name to be static. Meaning that you will have only "one" name saved in memory. So no matter how many instances you create there will always be ONE name in memory and will hold of course the last value entered. Each Student instance has a name …

Member Avatar for KKR_WE_RULE
0
142
Member Avatar for pssubash

Do you have both the .class files and the java files in the same folder? Test.java, Test.class, Menu.java, Menu.class ? I checked the code and it is correct. The difference is that I have declared a package. The code should work without one. But is is better to use one. …

Member Avatar for javaAddict
0
328
Member Avatar for mangopearapples

I would omit the line: add(TextArea,BorderLayout.CENTER) Since you created the scroll with the TextArea as argument, you might want to add only the scroll: add(scroll,BorderLayout.LINE_START) Because the scroll already has the TextArea. You can try that for starters.

Member Avatar for mangopearapples
0
280
Member Avatar for Abdel_eid
Member Avatar for Abdel_eid
0
97
Member Avatar for queenking

What I would suggest 1st: Why did you started 2 threads! If you didn't get an answer at the first then will answer when you double posted. What if someone starts posting at one thread then some one else does the same at the second? Then: I cannot understand that …

Member Avatar for masijade
0
226
Member Avatar for stroper

When you declare this: [ICODE]public char[][] bogglefield = new char[height][width];[/ICODE] The height, width variables are undefined, so they are zero, so the bogglefield array has 0x0 size. At the method: copyPreferences you give values to the height, width, but the array bogglefield has already been created with 0 size. So …

Member Avatar for stroper
0
472
Member Avatar for jsefraijeen

First of all you need to use only one Scanner. You don't need two. Remove the choice2. You don't need it. When you do choice = in.nextInt and you choose 3, then the check you put at the while will make your loop exit. And most importantly, you read the …

Member Avatar for Lourdupinto
0
420
Member Avatar for tinamary

[QUOTE=Pavie;1300530]can you tell me why we create constructor?[/QUOTE] We use/call constructors to create instances of objects. In that way we can call the methods of the class. We define different constructors for different functionality based on their arguments.

Member Avatar for peter_budo
0
185
Member Avatar for MrDiaz

The closer you can get is this: Try this: [CODE] System.out.println(Table.class); [/CODE] Or this: [CODE] Table tbl= new Table(); System.out.println(tbl.getClass()); System.out.println(tbl.getClass().getName()); [/CODE] [URL="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Class.html"]Class[/URL]

Member Avatar for masijade
0
10K
Member Avatar for gvarma123

Unfortunately you will have to read the entire line and then "extract" somehow the value under the column you want. You can use: StringTokenizer and loop as many times as you want to get to the column you want. OR String.split(" ") which will return an array and you will …

Member Avatar for MALINI JAGDALE
0
9K
Member Avatar for LianaN
Member Avatar for z00t

Check the API of the java.awt.Rectangle. More specifically check what the translate method does and [U]what it returns[/U]. Don't expect that methods will do what you want. Always check the API. [URL="http://download.oracle.com/javase/6/docs/api/java/awt/Rectangle.html"]http://download.oracle.com/javase/6/docs/api/java/awt/Rectangle.html[/URL]

Member Avatar for Akill10
0
1K
Member Avatar for Valten1992

[QUOTE=lazeto;1455859]Can anyone send me a finished project (tictactoe). I would be very grateful :)[/QUOTE] Do your own homework cheater. We don't give away homework. We help others do it and learn by doing it themselves.

Member Avatar for lazeto
0
927
Member Avatar for pscullion2001

The days left can be a static variable. The rest of the code can be put in a method. Every time you call that method reduce that variable by 1. Assuming that each call represents each day that passes. when the days becomes zero, with the help of the if …

Member Avatar for javaAddict
0
108
Member Avatar for GuruMS

What error do you get? You should also write like this: <img src="SOCIALWEBSITE/Image/login.jpg" width="250" height="250" alt="This is an image" /> Don't forget the /> at the end. The above will not solve your problem, though. You need to post what error do you get. Is the image file at the …

Member Avatar for peter_budo
0
6K
Member Avatar for wailoon88

Do you have the jar that contains that package? Did you put it to the classpath when you try to compile it?

Member Avatar for wailoon88
0
81
Member Avatar for ypks_destiny

If you are new to java and don't know how to read from database then why do go and do jsp pages. First learn java and then do jsp First learn how to read from database and then do jsp. And even if you knew all these you still need …

Member Avatar for ypks_destiny
0
2K
Member Avatar for mith_cool
Member Avatar for system analysis

First create a class name Fan.The class contains: Three constants named SLOW, MEDIUM, and FAST with values 1, 2, and 3 to denote the fan speed. An int data field named speed that specifies the speed of the fan (default SLOW). A boolean data field named on that specifies whether …

Member Avatar for javaAddict
-1
1K
Member Avatar for rakhi4110

Use javascript for doing whatever validations or client side displaying. When the user submits, whatever is inside the form that you have, will be sent at the action of the form where you can get it with java

Member Avatar for rakhi4110
0
138
Member Avatar for Java-Newbie

> I hsve error as identifier expeced error at > "synchronize public void static debit(float ba)" this line plz reply as early as possible class Demo { Acc a1,a2; String tot; AccU au1,au2; public static void main(String args[]) { a1=new Acc(1000,10000); a2=new Acc(50,50000); au1=new Acc(a1,"Ganesh","d"); au1=new Acc(a2,"Vinayak","c"); } } class …

Member Avatar for javaAddict
0
6K
Member Avatar for AhmedGhazey

Where this "change" will take place? Where will you be inserting the string? At a console or at a text field at a GUI ?

Member Avatar for AhmedGhazey
0
89
Member Avatar for ella_xhin

Read the methods used in the code downloaded and try to create your own for reading and writing to a file as well as creating a class to hold your data. Check the API for methods that you don't understand. Then read some tutorials on how to create a GUI. …

Member Avatar for javaAddict
0
75
Member Avatar for mbouster

The End.