36,051 Topics

Member Avatar for
Member Avatar for camilia

hi, does anyone know how to do login validation using java...here is my code,bt i cant validate if the username and pw typed are the user in the database. (The java code that i wrote) [CODE] public int Login(Friend fr) throws EventException { Connection con = null; System.out.println("Database connection succeeded"); …

Member Avatar for javaAddict
0
98
Member Avatar for jrosh

I used below code to extract year from a date object. [CODE] java.util.Date ye = new java.util.Date(); int y = ye.getYear(); System.out.println(y); [/CODE] But it prints ,109 How I get the year as 2009??

Member Avatar for jrosh
0
228
Member Avatar for isuruj

I am using emma-2.1.jar for getting code coverage for my java web application. For generating the coverage.ec file, every time I need to shutdown the tomcat server. But I heard that version 2.1 gives ctl tool for getting coverage.ec file without shutting down the server. But I don't know how …

0
61
Member Avatar for vtsmokey88

So i've converted a float array and int array into binary number. The problem is when I print out the binary values, java cuts some of the digits off depending on how much the value is. I've found this to be a problem with the int value because they don't …

Member Avatar for masijade
0
97
Member Avatar for swinefish

Hey all I'm writing a rasterizer at the moment, and one of the basic transformations you can perform is rotation. This demands the use of trig functions. However, when rotating a cube, my cube slowly shrinks. Is this s result of loss of accuracy in Math.sin() and Math.cos()? Or is …

Member Avatar for mrnutty
0
130
Member Avatar for DazednAngry

I am working on an assignment and I need a bit of help. I am using a double linked list to find roots of polynomials, the list has a trailer node only. I can't seem to get it to create a list. I figure I am just missing something small …

Member Avatar for BestJewSinceJC
0
131
Member Avatar for Logi.

Evening Folks, Having a bit of a problem with somthing i am trying to code, wondering if anyone here can help.... The basic idea is that i am trying to build a Priority Queue of binary tree nodes so that they are stored in ascending order by a number stored …

Member Avatar for quuba
0
886
Member Avatar for Karkalash

Hi: I have to write a program generating the fibonacci sequence based on the length desired by the user. I'm using arrays and methods too. So I have to do one method to generate the sequence and another to print the other method. So far so good, except the last …

Member Avatar for dotaa
0
2K
Member Avatar for runee1000

Hi, I just started learning java, so my skills are quite limited and I have yet to learn many many concepts. Right now, I am trying to create a hangman game(which as you can see is still incomplete). The problem I get is, the word being "mystery" when I guess …

Member Avatar for BestJewSinceJC
0
135
Member Avatar for anki.gulsvart

Hi. I´m trying to change a file-extension, but it doesn´t seem to work. When i use System.out.print() it says the new name, but the file in my computer doesn´t change. My code: [CODE]public String changefileextension(String filename) { int lastDot = filename.lastIndexOf("."); if (lastDot != -1) { filename= filename.substring(0, lastDot) + …

Member Avatar for JamesCherrill
0
78
Member Avatar for slatk3y

I am trying to do RMI Server-Client communication, but I get these exceptions when I try to run client: [CODE] java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1371 connect,resolve) at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323) at java.security.AccessController.checkPermission(AccessController.java:546) at java.lang.SecurityManager.checkPermission(SecurityManager.java:532) at java.lang.SecurityManager.checkConnect(SecurityManager.java:1034) at java.net.Socket.connect(Socket.java:519) at java.net.Socket.connect(Socket.java:475) at java.net.Socket.<init>(Socket.java:372) at java.net.Socket.<init>(Socket.java:186) at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22) at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128) at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595) at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198) …

Member Avatar for slatk3y
0
118
Member Avatar for vishalanuj

Hi,I am new to struts.i want to make a database connection with the help of a method call in some other class.I am not able to make the method for the database connectivity.Please if someone could help me.

Member Avatar for Cronless
0
64
Member Avatar for jman8877

this method checks if the array needs more slots , if it does it adds 5 more slots to the original array while keeping the same content and order of the content in the array how could u do this in a method that returns true and recieves add number …

Member Avatar for Cronless
0
271
Member Avatar for Sandar Khin

I want to make marquee link in jpanel.I meet a problem at paintComponent(Graphic g){ g.drawString(text,x,y); } I want to replace JTextField at the "text".Who can I help me?whoever,thank in advance.

0
60
Member Avatar for shobhit123

Hi can anybody tell me any link from where i can download a small jsp servelt project and deploy on my machine and get to know the code and understand it... i have read the basics of jsp servelts and need a sample project to understand a small project to …

Member Avatar for ithelp
0
183
Member Avatar for system analysis

please help me to Design and implement an application that reads an integer value representing a year from the user. The purpose of the program is to determine if the year is a leap year (and therefore has 29 days in February) in the Gregorian calender. A year is a …

Member Avatar for javaAddict
0
135
Member Avatar for emmybuuz
Member Avatar for peter_budo
-2
58
Member Avatar for jaimca

HI Please tell me how to create a new pdf file by merging two different pdf files dynamically in java ... please help me out thanks in advance..

Member Avatar for peter_budo
0
56
Member Avatar for Thendral

Hai.. I want to write a JSP program. In that i want to do insert, delete, display records in a same program. I connected to the database. its working fine. The problem is it displays the record in the window twice.(becoz it has two records). I need that to display …

Member Avatar for peter_budo
0
95
Member Avatar for aredroses

Hi, considering the tutorial given by peter_budo, if manager wants to assign a new course to a teacher, how would he be able to assign that ? I have designed the course page in which students can apply but how a manager can assign a teacher to that course ?? …

Member Avatar for peter_budo
0
67
Member Avatar for jrosh

[CODE] tdate= new JTextField(); tdate.setBounds(200,25,134,20); java.util.Date date = new java.util.Date(); DateFormat df = DateFormat.getDateInstance(); String s = df.format(date); a = s.split(" "); a2 = a[1].split(","); //a[0]=oct , a[1]=27, , a[2]=2009 , a2[0]=27 , int mon=0; if(a[0].equalsIgnoreCase("jan")){ mon=01; }else if(a[0].equalsIgnoreCase("feb")){ mon=02; }else if(a[0].equalsIgnoreCase("mar")){ mon=03; }else if(a[0].equalsIgnoreCase("apr")){ mon=04; }else if(a[0].equalsIgnoreCase("may")){ mon=05; }else …

Member Avatar for masijade
0
92
Member Avatar for jman8877

it checks if the array needs more slots , if it does it adds 5 more slots to the original array while keeping the same content and order of the array how could u do this in a method that returns true and recieves add number to put in the …

Member Avatar for masijade
-1
97
Member Avatar for jman8877

it checks if the array needs more slots , if it does it adds 5 more slots to the original array while keeping the same content and order of the array how could u do this in a method that returns true and recieves add number to put in the …

Member Avatar for masijade
0
282
Member Avatar for theStruggler

I have to write a program to censor a string. Whenever I run the program, it works fine the first time, then stops progressing the second time after entering the bad word. I don't get what the problem is. PLease help: java.util.Scanner; public class stringCensorRunner { /** * @param args …

Member Avatar for theStruggler
0
117
Member Avatar for cabosun

Ok I have done the main section of my MergeSort program. I have to accept 10 integers and put them into a list. I having trouble with inserting user input into a list. Can anyone help? [CODE]import java.util.Scanner; import java.util.LinkedList; import java.util.*; public class mergesort{ public static class lp{ int …

0
76
Member Avatar for gibson.nathan

i am trying to make a program that takes an object oriented approach to calculating the miles per gallon that your car gets. this is early in the process an i am aware that alot of stuff is missing. i am just trying to get it to work enough that …

Member Avatar for BestJewSinceJC
0
218
Member Avatar for jennaNalpak

Heya guys. I'm having a real problem with one of the examples on my java homework and was hoping one of you guys/gals could help. I need to write a program that allows the input of five numbers. Then the final output line(s) need to say which is the highest …

Member Avatar for BestJewSinceJC
0
166
Member Avatar for treyd

I have to write a program that diaplys a tic tac toe board with random x's and o's. I have having severe issues with the random part. I also dont know what to put for arguments in the JButton methods, but I think my issues are realted. Any and all …

Member Avatar for BestJewSinceJC
0
164
Member Avatar for StarZ

Does someone have the solution for this? I know this isn't homework serice I have no idea where to start off....... I don't want a game of life applet, just simple codes that can compile and run. pm, post if you do. thanks so much. Can someone help me make …

Member Avatar for BestJewSinceJC
0
98
Member Avatar for sleek182

I am thinking of developing a video conferencing system with multicast support....After some research I have decided to use java to develop this system with the aid of JMF. Has anyone developed a system like this, or could provide me with some useful links or information. Any help would be …

0
55
Member Avatar for Dhruv Shah

As I am new to MySQL, I dont know how to connect my jsp page to the MySQL Database. So please help me by giving some code on how to connect. I have downloaded driver for Java named as Connector/J. MySQL version is 5.0. In this line con = DriverManager.getConnection("jdbc:mysql://localhost/JSP_MYSQL?user=root&password=admin"); …

Member Avatar for masijade
0
2K
Member Avatar for chunalt787

I am trying to create a 2d array list but it is giving me a compiler error pointing at the first line of the function. I don't really get what is causing the problem. I am pretty good in C++ but Java has some new rules that I am trying …

Member Avatar for chunalt787
0
4K
Member Avatar for KirkPatrick

Hey guys I'm a bit confused here as I haven't edited a renderer before. My situation is that I have a custom object that I have created. It has a few jLabels, textboxes, and a combo box. And what I'm wanting to do it make it display on a jList. …

Member Avatar for Ezzaral
0
201
Member Avatar for deepak.marur

I have tomcat 6.0.18 running on my laptop. Tomcat is installed under my /home/xxx/bin directory. However, after I start tomcat, I'm unable to connect to tomcat through my browser but my eclipse is able to do so. I do not get any error message, the browser just keeps on trying. …

Member Avatar for deepak.marur
0
153
Member Avatar for Mykd

Hello I am new to java or well mainly everything. I am making a 'General Knowledge' game for a school project, I have a timer down and the questions. But I would like to know if there is a code I will be able to use to make points, for …

Member Avatar for KirkPatrick
0
77
Member Avatar for Web_Sailor

Hi.. I have 3 JPanels. (one) JPanel contains the scrollpane and the (two) JPanel contains a JButton. I am adding (one) + (two) into (combine) JPanel and then adding to the frame.Now I am really having a hard time align the scrollpane and the Jbutton. scroll pane is coming squeezed …

Member Avatar for KirkPatrick
0
150
Member Avatar for JimD C++ Newb

Good morning, all! I have a Java project that is complete, but it's not due for another week. I've been poking around trying to "spruce it up" a little with maybe a pull-down menu for one of the options. The examples I've found online all deal with web development. Will …

Member Avatar for JimD C++ Newb
0
145
Member Avatar for Ravenous Wolf

Hi Can anyone please tell me whether I can write a java program and start it in a way other that involves the command line? And not applets either. I want to start writting all of our company software in java, leaving behind c#. But the problem is I can …

Member Avatar for shruti123
0
243
Member Avatar for hello214

hi to everybody. I'm just wonderin' if someone can help me with arrays. I am making a program of computing an average grade. I manage to execute the first requirements. The problem i have is how can i compute the grades that had been entered using a seperate method here …

Member Avatar for hello214
0
118
Member Avatar for hajjo

Hello all I am using the request scope. I have parent window, which opens a child window on button click. Am using window.open That child window opened is request scope. Problem is, on that child window there is a button.. say I write "greg" in the textbox and click the …

Member Avatar for peter_budo
0
88
Member Avatar for jrosh

How can I limit the length of a text field.. I want allow entering specific number of characters in the text field?? Is there a constructor... I couldn't find 1.. plz help...

Member Avatar for BestJewSinceJC
0
120
Member Avatar for Gman36

Hi there, I'm attempting to write a program that does the target word puzzles you see in most major newspapers. The target word problem involves a 3x3 grid of 9 random letters that a user needs to be able to make words out of using at least the middle letter …

Member Avatar for Gman36
0
118
Member Avatar for Gman36

Hi guys, Just wondering if someone could help point out why the string value s1 in the for loop cannot be passed on to String input.... here is my code. Please ignore the commented out parts. Cheers for any help [CODE]import java.io.*; import java.util.*; import java.lang.*; public class gaelan3 { …

Member Avatar for Gman36
0
86
Member Avatar for SoulMazer

Ok, well I am JUST beginning to learn Java, and I have run into a little stumbling block. I am attempting to write a little applet, but it doesn't seem to want to run. My Java code: [code=java] import java.awt.*; import java.applet.*; public class TestApplet extends Applet { public void …

Member Avatar for jasimp
1
144
Member Avatar for EGutierrez91

I've run into a few problems with this one. I've tried my best following the directions. I can't figure out how to properly use "switch" since we haven't really put it to use in class. I want to create random integers (this I know how to do) that will become …

Member Avatar for EGutierrez91
0
1K
Member Avatar for gonzila

Hi Guys, I have a compiled java file example.class and i need to use the methods in this file to read from a text file. I need to have this file inside my package as requested by the teacher. However when i put the example.class file into my package and …

Member Avatar for gonzila
0
105
Member Avatar for yeungn

Hi I am trying to create a method that will substitute a value x with a value y in a basic array. Your assistance is much appreciated! Yeungn

Member Avatar for yeungn
0
113
Member Avatar for AnonSurf

Need to take input from a file as command line argument and put it in an array, but i keep getting .class expected on this line [CODE]temp[][] = infile.nextInt();[/CODE] Here is the whole code so far for reference [CODE]import java.util.*; class Temps { public static void main(String[] args) { Scanner …

Member Avatar for BestJewSinceJC
0
119
Member Avatar for kinger29

I have created a JApplet and I want to be able to clear the screen and draw new components depending on what button I click on. Right now the code below will clear the screen but it doesn't redraw the JTextFields (label_1 & label_2). However I did notice whenever I …

Member Avatar for quuba
0
249
Member Avatar for BlendedFrog

Working on a project that is basically a simple bowling program that uses a gui to read in from a given text file a pre-determined amount of names and scores...runs through the standard 10 frame scoring system, prints out the score, and who won. Now I can't seem to get …

Member Avatar for eggmatters
0
145

The End.