36,051 Topics

Member Avatar for
Member Avatar for Dio1080

My tic tac toe board is done, but I need it to show up in the Dialog box, not the console, how would I do that? Here is my code: javax.swing.JOptionPane.showMessageDialog(null, "\n-------"); for (int i = 0; i < 3; i++) { System.out.print("| "); for (int j = 0; j …

Member Avatar for Ezzaral
0
131
Member Avatar for hemanth.balaji

I am a student and have to submit a Mail Program. I have been asked to do the program using [B]GridBagLayout[/B]. The program is working fine but for the Layout. I just am not able to manage the layout problems I am facing in this program. Could I get some …

Member Avatar for Ezzaral
0
139
Member Avatar for Aprilia

Hi all, i'm new so not sure if this is the right place or not. But none the less i'm hoping someone can put me somewhere in the right direction! Basically i'm wanting to know is it possible to open ax existing exe? to create further add-ons to its existing …

Member Avatar for MattEvans
0
190
Member Avatar for pickachu

Im having arrayoutofbounds error on my code. [code] import java.io.*; class s{ public static void main(String args[]) throws IOException{ BufferedReader in=new BufferedReader(new InputStreamReader(System.in)); String[] a = {"X","C","O","M","P","U","T","E","R","S"}; System.out.println("Enter Price: "); String b = in.readLine(); for(int i=0;i<b.length();i++){ System.out.print(a[b.charAt(i)]); } } } [/code] what am i doing wrong here? The output should …

Member Avatar for Black Box
0
112
Member Avatar for cga2

Hey guys, I wanted to know how can I code the game ball lines in Yahoo. It is a game very easy to understand and similar to tic tac toe but I just cant figure out anything as to how to start. Please help!! u can mail me on [email]chandanagrawal17@hotmail.com[/email] …

Member Avatar for Black Box
0
139
Member Avatar for mrityunjay22

step 1 myeclipse->prefernces->myeclipse->application servers->choosing tmcat5.5 for application server Step 2 using jdk 1.5 clicking ok then clicking on icon to start and stop tomcat but it says that no default server present what might be missing plz tell

Member Avatar for mrityunjay22
0
167
Member Avatar for paradox814

I am using generics in java, and I want to know how I can test to see if I have a int or a float? Is there some sort of type-testing? I'm sure there is, I just need someone to help point me in the right direction. Thanks!

Member Avatar for jwenting
0
175
Member Avatar for Dio1080

can anybody see anything worng? I'm returning these to the main sO=ScoreO(O); sX=ScoreX(X); These are my two methods: [java] //method to tally the score for x public static int ScoreX(boolean X){ int scoreX=0; if(X==true){ scoreX+=1; } return scoreX; } //method to tally the score for x public static int ScoreO(boolean …

Member Avatar for Dio1080
0
91
Member Avatar for speterson

For a homework assignment, I have to create a random salary generator which is pretty easy. We have to create a random number of employees, 3-15 only and then the number of years of that salary with a limit of 3-15. This is easy so far. After this, we have …

Member Avatar for Ezzaral
0
356
Member Avatar for mauro21pl

Hi guys I started to learn java and have a little problem\. When I try to compile my little program it says : assgn2.java:40: variable overnight might not have been initialized System.out.println(overnight); [CODE]How is that? The code: import java.io.*; public class assgn2 { public static void main(String[] args) throws IOException …

Member Avatar for Black Box
0
139
Member Avatar for mimsc

Hi I want to populate my second drop-down menu based off of the value selected on my first drop down. Is there a function or a way of doin g this... P.S my code is in a JSP: [code=java] <% Vector theStates = WeatherDAO.getWeatherStates(); %> <html> <head> <meta http-equiv="Content-Type" content="text/html; …

Member Avatar for tommybobby
0
74
Member Avatar for abhishek2301

Hi, I am using a JSP from to collect data from user and then inserting those values into a table in MySQL.But it is returning 'null' always.I am able to query the DB and view the entire table and everything else is fine. But the INSERT is not working somehow!!! …

Member Avatar for tommybobby
0
148
Member Avatar for binayraja

Dear sir, I am using jsp(Model View Controller platform) for making web site. I have to create dynamic treeview by quering data from database. I think I have to use ajax , jsp code for making tree. Can anybody help me. Thanks.

Member Avatar for tommybobby
0
152
Member Avatar for staneja

I am executing a project that have 100 jar file attached to it I am able to execute it in Eclipse but i want to run it from batch file but the problem is that i am not able to set class path , whereas in eclipse we can direclty …

Member Avatar for ~s.o.s~
0
98
Member Avatar for Dio1080

I need help making a counter uusing a two dimmensional array. I'm doing a tic tac toe program and need about done, just need the counter and have no clue how to do it.

Member Avatar for Ezzaral
0
82
Member Avatar for degamer106

So we're supposed to modify this class, which implements Comparable, so that it accepts any type of object. The Comparable interface contains the method signature for compareTo, which I need to implement. What I'm uncertain of is how to implement this method. I know that compareTo is supposed to return …

Member Avatar for degamer106
0
86
Member Avatar for Danii

HI problem: Write the definition of a class Clock . The class has three instance variables: One of type int called hours , another of type boolean called isTicking , and the last one of type Integer called diff . You should also write a constructor that takes three parameters …

Member Avatar for ~s.o.s~
0
192
Member Avatar for freakhina

hey everybody!! i urgently need a project in java for electricity bill generation software kindly contribute as much as possible... i m in real trouble

Member Avatar for jwenting
0
82
Member Avatar for shikhu

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); //Registering driver type Connection con=DriverManager.getConnection("jdbc:odbc:proj"); // Assigning drivermanager con.setAutoCommit(true); //String str="insert into dovetail values('"+id+"','"+a+"','"+b+"','"+res+"')"; String str="insert into dovetail values('ASDF','Raj','1234','198')"; Statement stmt=con.createStatement(); // creating statement object int ret=stmt.executeUpdate(str); System.out.println(ret); if(ret==0) { System.out.println("Not Inserted"); } else { System.out.println("Data Inserted Successfully"); } /*str="select * from dovetail"; ResultSet resl=stmt.executeQuery(str); boolean val=resl.next(); while(val) { …

0
38
Member Avatar for alpakr
Member Avatar for tactfulsaint

Hello everyone please i need help .. i am new 2 java and i was given this assigment of which i dont even know where to start from...If anyone can help please IM me so i can send him the question or perhaps for a little guidance on how to …

Member Avatar for masijade
0
206
Member Avatar for learning2java
Member Avatar for Danii

Hi Please help me with this problem Write the definition of a class Play containing: An instance variable counter of type int , initialized to 0. A method called increment that adds one to the instance variable counter . It does not accept parameters or return a value. A method …

Member Avatar for Black Box
0
226
Member Avatar for Dio1080

I need help understanding why my code doesn't work while using number coordinates. I'm using a two dimensional array, I would like to post my code so you guys can check my errors, but I don't want anybody else to steal it, can anybody help?

Member Avatar for Black Box
0
119
Member Avatar for piers

I have been given a homework this is it: [QUOTE]Homework 7 Due in your lab in week 10 For this homework you are expected to write one program, which consists of a main method and an insertWord() method. You must work on the program outside the formal laboratory sessions. The …

Member Avatar for iamthwee
0
99
Member Avatar for hidash_in

hi, i am using tomcat server to executing the jsp files. my task is to open an application while clicking the hyperlink it throws an popup error msa Access is Denied. and also i used the path of a file in href it also not opening a file. give me …

Member Avatar for jspEthusiast
0
100
Member Avatar for sania kohli

hi, I have created servlets for hotel management. In that i want to create a search engine to search the customers by their name & by their room no so will u please help me out in that.

Member Avatar for darkagn
0
433
Member Avatar for rickster11

My loop keeps looping...even after the condition is changed to false. Whether I enter a "y" or an "n" my loop still loops. I know it's never leaves the loop, because I never get the "do I get here" println. This is my first time with booleans...so maybe I'm doing …

Member Avatar for masijade
0
147
Member Avatar for shipar

hello, i am a new comer. is it possible [COLOR="Red"]to read data (e.g. some integers followed by a unique word) from a defined web page of a defined web site?[/COLOR] if possible please help me or suggest me which language is appropriate to do the job.........

Member Avatar for shipar
0
111
Member Avatar for Java-Newbie

Is there a way to find if an entry is indeed a number without using try/catch? I want the program to keep asking the user to enter a number if s/he is "silly" enough to input something else. [code] System.out.print( "\n¿Edad minima a buscar? " ); edadMinima = input.nextInt(); [/code] …

Member Avatar for jwenting
0
154
Member Avatar for newbieGirl

Hello all -- found myself stuck on a certain bit of code dealing with a number pattern I put together. I've written out most of the code, but I'm stuck in 2 areas - thought maybe someone could help shed some light. It seems like it would be very simple, …

Member Avatar for Black Box
0
661
Member Avatar for newbieGirl

I guess I'm having a lot of problems tonight with this program I'm trying to accomplish for myself... I'm trying to write an application called TestNumFactors which defines a static method with header "public static int numFactors(int n)". When numFactors is called, it should return the number of factors of …

Member Avatar for darkagn
0
480
Member Avatar for hidash_in

[B]how to open any exe file using java. i alrerady used the Runtime.getexec() code. but when i refresh the page the application is opening. my thought is the application should be open after clicking the button in jsp page. if u have any code send me.[/B]

Member Avatar for masijade
0
117
Member Avatar for degamer106

So here's the problem [QUOTE]Write a program that asks the user to input a set of floating-point values. When the user enters a value that is not a number, give the user a second chance to enter the value. After two chances, quit reading input. Add all correctly specified values …

Member Avatar for degamer106
0
198
Member Avatar for newbieGirl

Just curious... I've got a snippet of code I'm trying to put together, and what I'm trying to get it to do is to print out the word "yes" exactly when i ends in the digit 4, or j ends in the digit 7, or both. I know my if …

Member Avatar for Ezzaral
0
86
Member Avatar for akhiero

I have been working on an inventory program for school and it is all working. What I need help now is making a GUI for it. To display one item at a time with a buttons like First Item, Next Item, Previous Item, and Last Item. Could someone help me …

Member Avatar for Ezzaral
0
203
Member Avatar for mrityunjay22

my jsp and servlet are in Z: drive and i want to configure eclipse for application server plz tell me how to do it

Member Avatar for lookof2day
0
140
Member Avatar for mrsmoke

Hi, I'm trying to make my own sokoban game in java. Sokoban is a top down 2D puzzle game where you move around a level trying to push boxes to the goal area in the least possible moves. I'm already pretty stuck at an early stage. My first objective it …

Member Avatar for schoolsoluction
0
119
Member Avatar for enes

i have java strategy game project.however ı dont know how can ı control the map.for example when player selected a dıvısıon how can ı get ıts poınts to know which division is selected.to be able to thıs ı should have all coordınates of the maps(every poınt).of course ıt ıs ımpossible.there …

Member Avatar for darkagn
0
104
Member Avatar for john_mark386

Hello, any tutorials in how to use bubblesort, selection and insertion? Help is greatly appreciated. Thank you.

Member Avatar for peter_budo
0
112
Member Avatar for rickster11

If someone has a second, could you please take a look at this. This is just a small part to a large program I have to write for school. Right now I'm just trying to get the arrays to load. I can't get my two dimesinal array to work (the …

Member Avatar for rickster11
0
755
Member Avatar for Cole

A picture is attached. I have a simple technical question. If Lizard extends Reptile which extends Animal, is Lizard a derived class of Animal? (Does not have to be directly derived, just derived.) Its easy stuff, review for the AP exam, I'm just trying to figure whether my teacher was …

Member Avatar for darkagn
0
65
Member Avatar for volscolts16

Problem: I am not sure how to get the Treeiterator started into the main, or how output to the file. Thank you in advance sorry for the long read, but it is a long project, for such little output. The assignment: Write a program that maintains the names, addresses, and …

0
63
Member Avatar for Cornflower

Hi, I need some help with an assignment - to read from a .txt file and count paragraphs, lines, words and characters. I've managed to write a program to read the file, and another one to count - but I've run into problems trying to incorporate the two. I've sent …

Member Avatar for Cornflower
0
119
Member Avatar for toncoolx

Hello there, I need a help form u guys, thanks advance~ I need to use JAVA to do a [COLOR="Red"]PC application[/COLOR] which can accept/receive data [COLOR="Red"]from a mobile device using Bluetooth[/COLOR] through some Bluetooth device plug on the PC. I am using Netbean now and trying the JSR 82, but …

Member Avatar for peter_budo
0
662
Member Avatar for gjancarik

ok heres the code im working with.. public boolean legalMove(int row, int column) { if (a.empty(row, column) == true) { System.out.println("This sqaure is empty"); return false; } } now my empty method header looks like .. public boolean empty(int row, int column) and the code inside for empty() works. now …

Member Avatar for Ezzaral
0
70
Member Avatar for thanaras

Hello. I am looking for a way to detect circles in an image. I know that circle Hough transformation does this, but i don't know where i can find a java or jai implementation to it. Is there anyone who could help? Thanks a lot in advance.

Member Avatar for Ezzaral
0
78
Member Avatar for harbir

I am using structs to try and get the "update" functionality working. I have a list of items appearing in the jsp page, "viewItem.jsp" . I am getting this list from the database. At the moment I am just displaying the item description, but item id is also available in …

Member Avatar for lookof2day
0
125
Member Avatar for nuch1311

[code] import java.util.*; public class Prj3 { static int data[] = new int[20]; static Scanner kb = new Scanner(System.in); static Random rnd = new Random( 1234 ); static void Create_array(int arr[], int max) { int i; for (i=0; i<100; i++) arr[i] = rnd.nextInt(max); } static void Draw_array(int arr[], int col) …

Member Avatar for eranga262154
0
86
Member Avatar for StephNicolaou

There isn't exactly anything wrong with my code, it's fine although the order isn't correct, I think, which makes my shapes appear behind the center panel. I'm not sure how to correct this as I've drawn my shapes under a paint method. I've tried moving the paint method before and …

0
70

The End.