32,204 Topics

Member Avatar for
Member Avatar for rishabh7777

Hi all, I am planning to make a web crawler as my new project. I have gathered all the Information about this and I have also started the developement part. Initially I started by making a connection to a particular URL using java. Now i am getting the contents of …

0
42
Member Avatar for cherryduck

Hey guys and guyettes, I'm trying to make a game, when you click on a card, a certain set of things happen to that particular card. As the set of actions that occur are the same for each and every card, putting everything in the MouseClicked event for each and …

Member Avatar for cherryduck
0
129
Member Avatar for Javano

Here are my answers: Do you agree with my answers ? /* Point A */ The decimal variable is in scope, It is a local variable. /* Point B */ Int decimal is a formal parameter String hex is a local Variable /* Point C */ Int hexValue is a …

0
46
Member Avatar for TGeorge824

So I'm simulating a File system for my Operating Systems class. I'm kinda lazy and didn't want to do it in C, so I did it in Java :(. I also didn't make any new data structures, I just made a File and Directory class, where the Directory class has …

Member Avatar for JamesCherrill
0
1K
Member Avatar for hatux

Hello there I have a small question. I've been looking on the web for it but didn';t come down with an answer. As far as i've read we can get user input from the console via Scanner [CODE] Scanner asdf = new Scanner(System.in); [/CODE] What if we wanted to analyze …

Member Avatar for kramerd
0
150
Member Avatar for ASIWYFA

Hey guys, I am having trouble with my java pacman game. What I have currently is the basics. I am reading in my maze from a txt file which is working. I am stumpted on how to replace the W for my walls with my jpeg of a blue wall(imgGhost …

Member Avatar for JamesCherrill
0
571
Member Avatar for arawani

Hai, can anyone help me? missing return statement error keep appear when i tried to run this code class CoffeeBags{ //Data member private static final double PRICE_PER_LB = 5.99; private static final double TAX_RATE = 0.0725; private int numberOfBags; private double totalPrice; private double totalPriceWithTax; private int bagWeight; //constructor public …

Member Avatar for arawani
0
94
Member Avatar for unikshegz

I am working on a java project,i want to sequentially read an ASCII file into an arraylist and then add a method to print out the array. i want to also be able to search through the ASCII file can anyone help me with the coding. will realy b much …

Member Avatar for unikshegz
0
133
Member Avatar for juniper2009

Dear All I am trying to learn JAVA with Eclipse.I have a class like Form.java and it has a form which contains 4 text fields.When I press the submit button(Register) I want my program to put every thing into a file(test.txt) line by line. I tried to do something from …

Member Avatar for JamesCherrill
0
131
Member Avatar for gunjannigam

I have a database hosted at a remote location. I want to access that database. But I keep getting the error [CODE] com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied for user 'username'@'%' to database 'db' [/CODE] This is the code that i have written [CODE] Connection con = null; Class.forName("com.mysql.jdbc.Driver"); String username = "username"; …

Member Avatar for gunjannigam
0
2K
Member Avatar for Dean_Grobler

Hello there, In one of my projects I'm working on currently. I have a 'cancel' button in my GUI window that is suppose to close the JFrame the button resides in. I have done some research on the web about this. But it seems like one has to write a …

Member Avatar for masijade
0
129
Member Avatar for iraqi4life

Basically, I have a project which I need create a output format of DD/MM/YYYY - Which I used in a toString, it works fine. I then used a switch case for all the days in a month, and of course I took into consideration the leap year. When I try …

Member Avatar for islam-morad
0
100
Member Avatar for appunu

Hello guys, I have coded something which would return the contents of a excel sheet as a hashTable. The code is [CODE] public Object[][] validDataProviderScenarioOne() { excelWorker excel = new excelWorker(); String pathValue = excelWorker.LocatingXls("Data.xls"); Hashtable<String, String>[] hashDrv =(Hashtable<String, String>[]) excel.contentReading(pathValue, "xxxxx_Login"); Object[][] obj = new Object[hashDrv.length][1]; for(int i=0; i<hashDrv.length; …

Member Avatar for kramerd
0
136
Member Avatar for LevyDee

Hi guys, as the thread says, im new to java. My department is more in the c++ side of things. My form class... [code] import javax.swing.*; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import java.awt.*; import java.awt.event.*; import java.util.ArrayList; import java.util.Vector; public class DogForm extends JFrame { private String _adminLogin = new String("admin"); …

0
63
Member Avatar for insanely_sane

Yeah... I have a headache... So I have the following code: [CODE]public class inc { public static void main (String args[]) { new inc(); } public inc() { System.out.println (addTwo(7)); } public int addTwo(int n) { System.out.println (n); if (n < 1) { return 2; } else { return addTwo(n-1)+2; …

Member Avatar for insanely_sane
0
158
Member Avatar for bonett09

[CODE]import java.util.Scanner; class CalcAvg{ public static void main (String args[]){ Scanner s = new Scanner(System.in); int sum = 0; int avg = 0; for(int i = 0; i < 10; i++){ System.out.println("Enter a number: "); int num = s.nextInt(); sum = sum+num; } avg = sum/10; System.out.println("The sum is: " …

Member Avatar for kvass
0
137
Member Avatar for hatux

Hello people. My aim is to assing an array with words read from system.in in a single entry. So if the users enters "Hello there" i will have 0,Hello 1,Therre I have managed to achieve this with the following piece of code. [CODE] import java.util.Scanner; public class mein { public …

Member Avatar for hatux
0
125
Member Avatar for ausops

I'm working on a constructor which lets the player input a starting sudoku grid and also checks if it's valid and can be played, ie, it doesn't already have duplicate numbers. The code listed here is my newest attempt and works on making each number +1 to another array. So …

Member Avatar for ausops
0
145
Member Avatar for kezkez

I am having a hard time figuring out how to use the db object created in the first action event within the second action... how can i make the object visible there? i am trying to say add a record to db object by saying something like ... class Action2 …

Member Avatar for kezkez
0
157
Member Avatar for Amrinder07

Hi!..I am Amrinder and i am new to java language as i am a student of Engg. i have to make a program using Swings or Frame in which Loop would be handled by Two different Buttons named as Start & Stop.....but how can i make a loop in ActionEvent …

Member Avatar for Amrinder07
0
145
Member Avatar for mcosta

Hello all, I'm sorry if this is an easy fix, but I've searched everywhere and spent 3 days on this and would like my life back. I'm trying to Select data from a database using a PreparedStatement and it isn't working for me. No errors, just no data. I can …

Member Avatar for mcosta
0
83
Member Avatar for AaronLLF

Hi. Hopefully this is my final question for this code. As you may know, I got a code from lloydgoodall.com for a Java & LWJGL FPCamera. It came with several errors, which I got to fixing, and after many, many Google searches, Option+Space's, and hitting my head against my desk's, …

Member Avatar for JamesCherrill
0
571
Member Avatar for jemimaloh

Hey, my code fragment is now this: [CODE]File fileName = "E:\\Major Project\\FinalLap\\278d.gz.txt.txt"; int index = fileName.toString().lastIndexOf("\\"); filed = fileName.toString().substring(0, index);[/CODE] And I hope to just get the file's name "278d.gz.txt.txt" after the last instance of "\\" and assign it to variable "filed". Can anyone tell me what am I doing …

Member Avatar for jemimaloh
0
123
Member Avatar for Khodz

So I'm working on a database-type program for the Java course that i'm doing and i seem to have run into a bit of a roadblock. This class compiles and runs alright but where i have a problem with it is when i try to amend the text file using …

Member Avatar for Khodz
0
191
Member Avatar for ponens

So I am fairly new to Java and I have been trying to create a simple program that reads a list of names and a number from an external text file. So I will show you that code first. [CODE] public static void startReadFile() { // Get an ArrayList of …

Member Avatar for quuba
0
133
Member Avatar for afas87

hi.... Iam working on file compression using Huffman algorithm... my problem is that when i try to restore the compressed file.. only text file can be recovered.. other file recovered with the size; but cant be opened i read byte each time from the file to restore it thanks...

Member Avatar for quuba
0
35
Member Avatar for famida

how to validation of textfield in java using netbeans IDE 5.5 i have done with validating the length of Textfield i need for number like if text values is number then i want a message to b displayed please help...........

Member Avatar for peter_budo
0
242
Member Avatar for compe_dsd

this doesn't really involve codes but.... i have a problem in using my netbeans...i'm still new to this program and i don't know the controls and menus...I made buttons/JButtons but I don't know what to do next. I want that when I click a button, another lists or box will …

Member Avatar for famida11
0
117
Member Avatar for jems5

With this code segment, I must be able to output text file data with names of persons along with int values after performing calculations. The program isolates the names, int values and float values and should output the percentage of each value as a functions of total... example out is... …

Member Avatar for quuba
0
99
Member Avatar for Javano

Ok well i have a function called drawVerticalLine and it's method header is the following : void drawVerticalLine(int[][] img,int lineWidth, int linePosition) so what happenes is a picture is converted to a 2d array etc and passed on to this function, now the goal is to draw a red verticle …

Member Avatar for tong1
0
106

The End.