32,199 Topics
| |
Hi there, In my little code snipet below I am trying to convert an arraylist to an array of type contact. Obviously it's expecting an arraylist of type contact to convert it to an array of type contact. But it's picking up the arraylist as type object for some reason. … | |
hi all i have 2 files one of which is a gui, the other a java file. I need to take my gui input and put it through the java file. How do i do that? I've tried calling the classes but the input just doesnt seem to be going … | |
I am getting an array out of index error 26 pls I really need help. [code]import java.util.*; import java.util.Random; import java.lang.*; public class testing1 { public static void main(String[] args) { String pass = new String("ENTER THE HAMLET HAM TO BE OR NOT TO BE THAT IS THE QUESTION WHETHER … | |
Hi All. Im in the process of writing a basic payroll program in Java. It is for some school work and I am really struggling with it. I have been working with it over the last 3 weeks and have not accomplished much. Below is what I have done so … | |
Hi guyz. I know this is a simple one but Im a bit confused in doing this. Basically, I want to get the Screen Resoultion of the client machine using my JSP. I have this code in my Bean. [CODE] Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); return screenSize.getWidth(); [/CODE] Problem is it … | |
question states for me to have the prog read #'s inputed from the user in the range of 0 to 50 inclusive, count how many times each # was inputed, then print all #'s imputed and how may times they were. this is what I have so far.... [code]import java.util.Scanner; … | |
I'm doing a BankAccount class and in the constructor I need to validate if the string in which the account number is written, is all numeric. Any ideas on how I can accomplish this? Also, it must be of 4 digits...is there some method of the String class that can … | |
Hello, I am trying to return the union of two ArraySet Strings as a third; however, the compiler is complaining: found : jss2.SetADT<java.lang.String> required: jss2.ArraySet<java.lang.String> union = one.union(two); I was thinking I could pass an ArraySet<String> as the parameter but unfortunetly I am stuck here. Any suggestions on how to … | |
I have to have the tire pressure of the two back wheels the same and the two back wheels the same but it doesnt seem to be working. [CODE]public class Pressure { private int fr; private int fl; private int br; private int bl; public Pressure() { } public void … | |
Hello! I'm working off of a problem in my "How To Think Like A Computer Scientist" textbook. The exercise in the book is having me work with a deck of cards. I receive two errors in my current code. The first is that every method after Class Card {...} says … | |
The code I'm writing reads in something like this from a file: 95 34 89 100 25 100 84 62 78 98 Mary Elizabeth Smith And outputs this to the same filename with a different extension: 88.25 Mary Elizabeth Smith I wrote a test program to test the calculation methods … | |
I'm developing a program based on the Tower of Hanoi. It accepts the number of discs and returns the amount of turns it takes for those discs to complete the conundrum. All of my inputs work fine, until the input (d) is greater than 31. Is the result too large … | |
| Hi, I'm trying to multiply two linked lists and return the result as a linked list. Any ideas? |
Hi! I would like to add a timer to JTextField. However, my timer does not run. Could you, please, tell me what is wrong in my code. Thanks! [CODE] timerTask = new MyTimerTask(); timer.schedule(timerTask, new Date(0), 5000); // 5 seconds delay ... private class MyTimerTask extends TimerTask { @Override public … | |
I'm supposed to implement a queue using a singly linked circular linked list (it also has to be generic). It keeps saying there are incompatible types at lines 44 and 45. I've honestly been trying to work this out for hours, but I don't understand what i'm doing wrong. Any … | |
I'm creating a system that has a parameterized class "TypeModule<T>". Now, I have another class that has the following member; [CODE]private LinkedHashMap<Class, ArrayList<TypeModule>> m_modules = ...[/CODE] Here's my dilemma. I need something more like the following; [CODE]private LinkedHashMap<Class<?>, ArrayList<TypeModule<?>>> m_modules = ...[/CODE] The only thing is, I need the '?'s … | |
Hi everyone im a bit confused with my work and i hope you can help me. i need to get some values from a text file and enter it into a 2D array ive done this part ok with the following code however in my file i have some other … | |
I am generating random numbers and want to write them into a file. But its writing them in binary and I am not able to open them using a text editor. How do I write them in Ascii? Also what is the fastest method to write them into a file? … | |
hey guys/...am stuck at one point....help me please! ! ! its a quiz progg... one ques...4 options... i have one button---NEXT QUES--- It should display the next ques--it should also take the user selected option, compare it with the correct option and show if the Answer is right or wrong … | |
Hello, I have created a simple frame, and in it there are 3 panels.I have a button in the bottom panel, and when pressed should display the text "You pressed the button", in the mainPanel.However this is not working.Can anyone shed some light as to what I am doing wrong … | |
Hey guys, im just learning how to use methods but I really cant seem to understand them. We have a question where we have to write a program for the following game. There is a little known dice game which is played with a pair of dice and has the … | |
Hi guys, Im pretty new to programming so bear with me if you think this is baby stuff:P Ive just been introduced to methods last weeks and after a week of study Im no better at understanding them. The problem is I just seem to grasp how to you them … | |
Hi there friendly people of daniweb. My problem is that when i double click an executable jar file, nothing happens. Even when i use command prompt and type java -jar "filenae" it doesnt work. Any ideas why? | |
i have written the code in client,server,interfaces.i have created stubs and skaleton. i have run rmiregistry very well.i have run server.i have an error in client side,when i run client.it is moving to the catch not looking up to the correct address of server. the code of client is: [CODE]import … | |
[code=Java]import java.io.IOException; import java.io.PrintWriter; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; public class DeleteProductServlet extends HttpServlet { protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, SQLException { response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); try { DBManager db=new DBManager(); Connection … | |
hi! please help me for the best and easy open source CMS(Content Management System) software for java to design a dynamic website . If possible please post the link from where i can download the same. please reply ... it's very urgent :( Thanks! | |
hey guys... i made a database using Access....it consists of questions and 4options each... i made a quiz progg through java and connected the database using jdbc.... before,since it was my trial attempt, i entered silly ques into the database like whats ur name with 4 options....just to check if … | |
How can i set fixed size of Jpanel where during execution of the program i shouldn't be able to RESIZE that Jpanel? plzzz help !!!!!!!!! | |
Hi All, In my development of an online application, I have to generage the serial no for the available number from the serial number table in sql server. Multiple users will hit the table to generate the serial numbers. So the serial number should not be repeated. I have to … | |
Most of the posts here are from people with problems, looking for help. I thought I would try to talk a bit about ways to find your way out of "stuck". It's been on my mind lately, since I've been wrestling with Swing and it's been winning. Finally worked out … |
The End.