32,199 Topics

Member Avatar for
Member Avatar for bibiki

hey there, I have two classes with a one-to-many relationship. For ilustration: public class Customer { Business business; Date created; } public class Business { } Now, when I do the following: new StringBuilder().append("SELECT business FROM ").append(Customer.class.getName()) it works perfectly fine. However, when I include filtering based on created field …

Member Avatar for bibiki
0
138
Member Avatar for inabahtrg

Good day I’m new with JSP, here the problem, I just converting the code from SQL to PostgreSQL, but a problem occur after I change to DataSource ds = (DataSource)envCtx.lookup( "jdbc/postgres" ); and add a scheme to the query. By theory it should be ok but it produce this error …

Member Avatar for LastMitch
0
2K
Member Avatar for G_S

Hello I am a little confused. I had always thought that a class can have objects from other clases as attributes. My teacher recently told me that this is not true... so I am confused now: if one of the attributes of my class is a String, would that be …

Member Avatar for G_S
0
194
Member Avatar for shoaib672002

Ok this the problem i want to download the applet or if not i want it as a animation (swf or gif) Go to this website http://www.colorado.edu/physics/2000/index.pl then click applet tumbannails then go to laser (by srcolling) i want all four applets or make into animation

Member Avatar for stultuske
-1
41
Member Avatar for MasterHacker110

I made this very simple applet just for fun but it doesn't work: package applet; import java.awt.*; public class Applet extends java.applet.Applet { public void init() { } public void paint(Graphics g) { g.drawOval(0, 0, 250, 100); g.setColor(Color.RED); g.drawString("First Applet", 10, 50); } } And heres my HTML code: <html> …

Member Avatar for JamesCherrill
0
183
Member Avatar for chdboy

I have Class called ConnectionDB and in this class I have Main method and another function in the class ConnectionDB,That is private static Connection DBConnectionstring() In this function I have Connection URL ,Drivers inside this function . I want this function to be used in another class (GUILogin) with main …

Member Avatar for chdboy
0
203
Member Avatar for bhallarahul

hello I have a xml like this: <book> <Publication> myPublication0</Publication> <Publication> myPublication<bookName> my book</bookName></Publication> <Publication> myPublication1</Publication> <Publication> myPublication2<bookName> my book2</bookName>asd</Publication> </book> and i want to read through java program and want output like myPublication0 myPublication<bookName> my book</bookName> myPublication1 myPublication2<bookName> my book2</bookName>asd please tell how to get given output

Member Avatar for stultuske
0
178
Member Avatar for joseph.lyons.754

Hey Guys, So I was doin a tutorial and I incorporated it into my code and it works for the most part. The program gives you a list of town names you pick one and hit search. All good so far then the program goes into the database and pulls …

Member Avatar for joseph.lyons.754
0
279
Member Avatar for yyzdslr

I need help with 2d arrays i've posted the problem here [Click Here](http://www.java-forums.org/new-java/71879-please-help-me-im-almost-there.html) (i've posted the problem on java-forums as well) Could someone please tell me what i'm doing wrong or how i could fix this? Thanks!

Member Avatar for JamesCherrill
0
309
Member Avatar for fatalaccidents

Hello all, I'm having trouble writing a spell checker as my recursive function isn't returning what I would like it to. It is meant to chop off the ends of words likes "baker" to bake and check against a predined dictionary. I used recursion for words like "baker's". I have …

Member Avatar for bguild
0
176
Member Avatar for skbluecollars

str1=new String(data,0,data.Length()) why the zero is used in the string function please explain me the what this line says???

Member Avatar for JamesCherrill
0
123
Member Avatar for yavindu

can anyone send me a link for, free video tutorials for java web component development with netbeans.

Member Avatar for LastMitch
0
57
Member Avatar for game06

in enemy bullet class i am creating two different kind of bullets. 'animationFire' and animationFire2. Enemy Bullet class public void paint(Graphics g) { g.drawImage(animationFire.getSprite(), (int)(x),(int)(y), width, height, null); g.drawImage(animationFire2.getSprite(), (int)(x),(int)(y-30), width, height, null); g.drawImage(animationFire2.getSprite(), (int)(x),(int)(y+35), width, height, null); } In Enemy Class i am shooting the bullets. i am doing …

Member Avatar for game06
0
138
Member Avatar for adrian9989

I am trying to write a server-client application for file transfer: the client written in Java and the server written in C++. Unfortunately I have the following error: "java.net.SocketException: Connection reset by peer: socket write error". Here is my code for client: import java.io.*; import java.net.Socket; public class Proba_binar public …

Member Avatar for ktsangop
0
2K
Member Avatar for jalpesh_007

i have made one program,but it will give none of the port number. Following files i have made **SimpleRead.java** import java.io.*; import java.util.*; import javax.comm.*; import java.nio.ByteBuffer; public class SimpleRead extends SpeedometerExample implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; byte[] readBuffer=null; InputStream inputStream; SerialPort serialPort; Thread readThread; …

Member Avatar for JamesCherrill
0
330
Member Avatar for kay19

Well I need help on moifying my report regarding SearchTree.java(Working with Recursion) "Modify the private report to have an additional parameter which indicates the level of indentation at which the visit should be displayed. The public version of report should be modified to call the private version with an indentation …

Member Avatar for riahc3
0
174
Member Avatar for SylvanSagacious

I have a UDP server and need to perform an "all" function. That means when a user sends "all blah blah" the server checks a list of clients and sends "blah blah" to all of them. I've stored the clients in a HashMap and I'm trying to figure a way …

Member Avatar for SylvanSagacious
0
394
Member Avatar for dlgmu537

I have written a super class called Parent.java and it was extended to create a subclass called Child.java. The super class can be compiled properly, but when the child is compiled an error is poped up. //parent class package abc; public class Parent{ protected int st_marks=180; } //child class package …

Member Avatar for jalpesh_007
0
190
Member Avatar for HankReardon

Hello Friends, Can someone please advise me on how to print an array inside of a GUI text field? Thank you, Jim Here is some of my code. /** This private inorder method recursively traverses a binary tree in inorder. @param btree The root of the tree to traverse. */ …

Member Avatar for jalpesh_007
0
2K
Member Avatar for Red_Rain

Hey guys, Writing a project for school and having a little trouble. We are creating a social media program and the teacher never taught us to use databases so we have to store all the data in text files. One of the requirements is to for the users to be …

Member Avatar for mKorbel
0
253
Member Avatar for zebusman

Hi Friends I have just started learning Java.I am getting a problem may be a small one but i coundn't able to figure it out.so here is my Servlet code iam trying to insert data into database after submitting form iam getting **java.lang.NumberFormatException: For input string: ""** I want to …

Member Avatar for zebusman
0
373
Member Avatar for game06

i am tring to debug this problem for about a week but had no luck in it. ![522461a63915f3683bcd1e3e8f00d81d](/attachments/large/4/522461a63915f3683bcd1e3e8f00d81d.gif "522461a63915f3683bcd1e3e8f00d81d") Take a look at this image above. This is how i want the bullets to look like. shoot red lines. ![da7b3eb64b1486e6fec4b7c680889fe7](/attachments/large/4/da7b3eb64b1486e6fec4b7c680889fe7.gif "da7b3eb64b1486e6fec4b7c680889fe7") Now take a look at this image above. I …

Member Avatar for JamesCherrill
0
205
Member Avatar for mferarri

i got this problem from: http://codingbat.com/prob/p178318 This is the question: > Given a string, return the count of the number of times that a substring length 2 appears in the string and also as the last 2 chars of the string, so "hixxxhi" yields 1 (we won't count the end …

Member Avatar for mferarri
0
237
Member Avatar for jalpesh_007

i am new to spring framework. i have learned basic concept of Spring.Now i am trying to simply run one hello world application using spring. i am getting following error.i dont know why? i am using netbeans 7.2 and spring framework 3.1.1 Release. **hello.java** public class hello { private String …

Member Avatar for jalpesh_007
0
1K
Member Avatar for Lynick

Okay so basically my problem is that I have to prompt the user for a set of floating point values once . If they do not enter the right data type then I have to prompt them again. If they dont enter the right type the second time I quit …

Member Avatar for Lynick
0
301
Member Avatar for nova4005

Hello everyone I just finished my last program for class this semester and would love to have some feedback from the memebers here on things that I still need to improve on or good coding practices that I may not know about that can help me become better. I have …

Member Avatar for nova4005
1
464
Member Avatar for Kosamov

Hi Everyone, I've been working on creating this code for a project I've been working on but I can't seem to get it to work. I'm creating a service class that I can then pass to a client class that will read a list of cities that ends in a …

Member Avatar for abhi_d_one
0
171
Member Avatar for hitro456

Hi all, I have some data in the file, which I want to store in the following format : 23 345 9.8 25 457 9.0 11 237 8.3 86 32 2.3 and so on..... I want to store this data in in some data structure, and later I want to …

Member Avatar for JamesCherrill
0
180
Member Avatar for milkman93

Hey everyone, I want to add action listeners to JButtons that were created dynamically by an ArrayList. Here is the code for the button creation. numOfCourse = 6; courseBtnArray.add(new JButton("Course 1")); gbc.gridx = 2; for (int i = 0; i < numOfCourses; i++) { gbc.gridy++; add(courseBtnArray.get(i), gbc); courseBtnArray.add(new JButton("Course " …

Member Avatar for mKorbel
0
484
Member Avatar for bhallarahul

Hi Everyone I need some Assistance, what i am actually doing i read text from pdf and write it on word file(.docx) which is perfectly working but problem is that content of next page is merge with the content of previous page. Now what i want is that when it …

-1
70

The End.