36,051 Topics

Member Avatar for
Member Avatar for harika.jo
Member Avatar for chloeclover

Hey all, i'm looking for some help/advise on how to tackel a piece of code i'm stumped on. My project is in netbeans, GUI swing, JForm. Ive made up all my gui appearance, i have a jtext box that shows the calculations of 3 other jtext boxes from a user's …

Member Avatar for peter_budo
0
263
Member Avatar for BEBELINDO

Hi i need an event handler method to let an user use the 4 arrow keys (up,down,left,right) from a keyboard input ... and also the letters "Y" for yes and "N" for no on the keyboard. [code]import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; //group Albers, Rodriguez, Gonzalez, Leys, Larson, and Aponte …

Member Avatar for stultuske
0
126
Member Avatar for OzY360

Hi, I am getting a rather odd error message when I try compile a java program. I have attached the original java code and a copy of the error message in a .txt file. Any help you guys can offer will be much appreciated.

Member Avatar for OzY360
0
135
Member Avatar for rogue005

I am using a PriorityBlockingQueue in my server program for a network printer manager, but the thing is whenever I print the size of the queue its always 1. I think it is cause i am using threads in my program to support multiple clients. How do i solve this …

Member Avatar for rogue005
0
143
Member Avatar for rowdyboudy

Hi guys, I have written the following code which iterates over a integer array and returns a string by concatening the digits. Is there is an easier or more efficient way of writing this in Java similar to the C# function ToString? [CODE] private int[] myArray; public int[] getMyArray { …

Member Avatar for peter_budo
0
140
Member Avatar for mattyd

I have one, reoccurring issue that arises each time I run this incomplete program I am working on; I have spent much time attempting to locate the bug. I am convinced it arises from a simple error. Problem: User has made a "deposit" but when the User makes a "withdrawal", …

Member Avatar for peter_budo
0
96
Member Avatar for oggiemc

Hi Everybody, Im having a bit of a problem with an assignment..Im trying to write a JDBC servlet which checks the value of a name in the database against the value inputed in a form..USER and PASS are the values inputted to the by user into the form.. The code …

Member Avatar for oggiemc
0
83
Member Avatar for ozrayleigh

Hi, I've been giving this little problem of mine a lot of thought and I cant seem to figure out a way to solve it. I'm creating an information system (for a college assignment). The system I've created uses java, and it is able to generate reports (which I use …

Member Avatar for peter_budo
0
129
Member Avatar for aditya_22cent

[B]amru.java :--[/B] [code=java]package test; public class amru { public static void fa() { System.out.println("ADitya"); //return; } }[/code] -------------------------------- [B]INDEX .jsp[/B] [code=jsp]<%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%@page import="test.amru"%> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body> <h1>Hello World!</h1> <% amru adi = new …

Member Avatar for peter_budo
0
85
Member Avatar for systemsbiology

Hello Everyone, I am an intermediate developer in programming languages. I have developed some python script and some java applications. In my project, I need to integrate the python script with a java application to put all the tools in a single pipeline to function as a continuous workflow. This …

Member Avatar for ~s.o.s~
0
981
Member Avatar for jtodd

Hey guys! I am new to java and have a newbie question. In a linked list, if I wanted to set the int first = to the first node in the linked list how would I do that. Thank you all in advance for your help!!

Member Avatar for tiny7415
0
86
Member Avatar for SCoder1

what's wrong with my java code? NullPointerException was found by my compiler.... [code] import java.awt.event.*; import java.awt.*; import javax.swing.*; import javax.swing.event.*; class WheelCalc extends JFrame implements ActionListener { public static final int WIDTH = 400; public static final int HEIGHT = 400; public JLabel NewTire; public JLabel OldTire; public JTextField …

Member Avatar for stultuske
0
152
Member Avatar for rpineres

I'm currently working on a small text game project as an exercise in Java. Just recently, I've come to a point where I am having difficulty with the logic behind the flow of the program. It had started out as a console application with a very sequential series of events …

Member Avatar for stultuske
0
123
Member Avatar for David22

Hi guys. I'm having a bit of a 'mare trying to return some ResultSet results. Basically, my method gets the results from a database and builds a String of the information and returns it. However, I can only get the method to return the LAST constructed String, as the "result" …

Member Avatar for vchandra
0
119
Member Avatar for annazpereira

Hi Guys, I know loads of ppl hv seen similar problems but I just can't figure out whats wrong with my code. I keep getting the following error: Upgrade.java:133: unreported exception java.lang.Exception; must be caught or declared to be thrown new SpFwUpgrade(sp, UrlPath); SpFwUpgrade is called in Upgrade.java as follows: …

Member Avatar for annazpereira
0
215
Member Avatar for rowdyboudy

I need to write a method that returns true if all the values in two int arrays are in the range 0-10, otherwise the method returns false. The code I have written is below but is there a better/more effient way to do this? [CODE] private int[] myArray1; private int[] …

Member Avatar for Zetlin
0
86
Member Avatar for johndoe444

from here: [url]http://weblogs.java.net/blog/emcmanus/archive/2007/04/cloning_java_ob.html[/url] [CODE]package serialclone; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InvalidClassException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.ObjectStreamClass; import java.io.OutputStream; import java.util.LinkedList; import java.util.Queue; public class SerialClone { public static <T> T clone(T x) { try { return cloneX(x); } catch (IOException e) { throw new IllegalArgumentException(e); …

0
70
Member Avatar for Zetlin

Ok so I'm learning from the book Head First Java, second edition, and I'm having a little trouble with some code. The code I'm working with compiles just fine and gives the output that I want(sort of) but whenever I run the code is doesn't stop, as if it was …

Member Avatar for Zetlin
0
216
Member Avatar for simplyflawless

hey I'm trying to write a method that converts milliseconds to hours, minutes, and seconds using the following header: public static String convertMillis(long millis) My method needs to return a string as hours:minutes:seconds. For example, convertMillis(5500) returns a string 0:0:5. this is what i have so far, can someone please …

Member Avatar for Zetlin
0
5K
Member Avatar for BEBELINDO

[code]import java.applet.*; import javax.swing.*; import java.io.*; import java.net.*; public class Audioapp extends JApplet { public class Sound // Holds one audio file { private AudioClip song; // Sound player private URL songPath; // Sound path Sound(String filename) { try { songPath = new URL(getCodeBase(),filename); // Get the Sound URL song …

0
53
Member Avatar for emteez

I am Linux server with cPanel. My problem is that i keep getting PermGenSpace error; even though i have set the -Xms and -Xmx attributes in starttomcat under /usr/sbin. I have searched thru the net, but I am not been able to find any solution to my problem. Any suggestions?

Member Avatar for ~s.o.s~
0
66
Member Avatar for benasour

[CODE]private List list(int... ints) { List result = new ArrayList(); for (int i : ints) { result.add(i); } return result; }[/CODE] I got this method from one of my friends and wondered what it does? I have never seen int... ints construct before but am assuming it is an array …

Member Avatar for BestJewSinceJC
0
88
Member Avatar for jfAdik

Hello Coders out there... I posted my code for a binary search tree assignment and the code is a working code... :::::DETAILS TO KNOW ABOUT THE CODE:::::: the program is required to 1. ask user the HEIGHT OF THE TREE which will determine the length of the array.. 2.and then …

0
47
Member Avatar for Lokeshmsit

i m creating a Client/Server application in which my server and client can be on the same or on different machines but both are under ISP. [B]My RMI programs[/B]:- -Remote Interface:- [CODE]//Calculator.java public interface Calculator extends java.rmi.Remote { public long add(long a, long b) throws java.rmi.RemoteException; public long sub(long a, …

0
170
Member Avatar for cool_jatish

Hi everybody..................... how to read a unicode characters (arabic characters) form ResultSet object which appears after extraction as question marks like this(?????) ................. I want to display the fetched UNICODE word from the database and display it in JTextArea............... but getting the same output..............[??????] If anyone knows method to display …

Member Avatar for cool_jatish
0
145
Member Avatar for gayatrib

Hey i have a problem with jsp can anybody help me plz? I want to fetch the data stored on server from the client. If anybody has any solution plz let me know... Basically i want to run the project stored on server from client.... what are the steps for …

-1
59
Member Avatar for bertyhell

I'm looking for a package that can convert a phone number to its country code i know how to write it myself but beter to check the net first anybody ever heard of something like this? eg: 0032586987 > Belgium please give me a link it would save me enormous …

Member Avatar for bertyhell
0
4K
Member Avatar for halluc1nati0n

Aight. I have a query regarding File I/O : [CODE]// Keep reading the file in a loop for some 100 seconds.. for (int x=0; x<100; x++) { // Code for reading file - say readFile() Thread.currentThread().sleep(1000); /* sleep for one second */ }[/CODE] Now, I need to read a file …

Member Avatar for halluc1nati0n
0
625
Member Avatar for JSPnewbie

I have a problem I hope someone can help me with in JSP. Whenever I write code in the JSP page, netbeans underlines it as illegal saying "The content of elements must contain well formed character data" E.g [CODE]<% System.out.println(request.getParameter("user")); %>[/CODE] Why is this wrong? I haven't been able to …

Member Avatar for peter_budo
0
88
Member Avatar for doha786

hi, i am looking for simple method to copy more than 2/3 arrays into one array.. so far i just learn to copy only two arrays at a time.. [CODE]String[][] data=new String [10][]; String[] column={"Name", "Age", "Sex"}; String[][] first={{"Calvin", "male", "23"}, {"Kathy","female","21"}}; String[][] second={{"Ravi","male","26"},{"Jesan","male","25"}}; String[][] third={{"Jacky", "male", "32"}, {"Jami","female", "23"}}; …

0
75
Member Avatar for gigsniper

[CODE]client.java:18803: orphaned case case 130: // Clicking some stuff in game ^ client.java:24856: illegal start of expression private int somejunk; ^ client.java:24948: illegal start of expression public int EssenceMineX[] = { 2893, 2921, 2911, 2926, 2899}; ^ client.java:24949: illegal start of expression public int EssenceMineY[] = { 4846, 4846, 4832, …

Member Avatar for masijade
0
140
Member Avatar for BobbieJean

Hi, I'm having trouble with...I don't know, either choosing the correct loop to use or maybe using the one I need but having it incorrectly placed. Right now, the program will give the "Invalid item number" message from my else statement if I enter an invalid value in the first …

Member Avatar for BobbieJean
0
99
Member Avatar for BobbieJean

Hi, I've been working on this program for nearly two days straight and I just can't get it quite right. So it's supposed to get input from the user and apply it to a switch statement. There are 5 cases that represent the cost per item for each case. Then …

Member Avatar for BobbieJean
0
102
Member Avatar for sirtrucker

I have my calculator GUI to display as I want it too. When I put in my mortgage amount and choose an option from the drop down box and hit calculate everything works as it should but when I try to manually put in the terms and interest rate and …

Member Avatar for jwenting
0
204
Member Avatar for chico9

Hi all, I'm working on a Hanjie solver and this is part of the code. Everything else seems okay but I always get an error when I run it. Eclipse (i'm using Galileo version) points the exception to be at: [CODE] char a = combo1.get(i).charAt(i);[/CODE] combo1 ...refers to a List<String> …

0
95
Member Avatar for iamsmooth

So I have junit tests, let's pretend this is my code: [CODE] @Test public void test1() { Object o = new Object("123"); AssertTrue(o.string == "123"); } @Test public void test2() { Object o = new Object("456"); AssertTrue(o.string == "456"); } [/CODE] Let's pretend the code has a public string field …

Member Avatar for iamsmooth
0
99
Member Avatar for chaos123456

Hi all [CODE]import java.io.*; public class POManager { private static String posFname = "C:/ITM200/OOP-Advanced-Topics/src/po.txt"; private static String taxposFname = "C:/ITM200/OOP-Advanced-Topics/src/tax.txt"; public static void main(String [] args) throws IOException { PO[] pos = readPOFile(); writePOTaxFile(pos); } public static PO[] readPOFile() throws IOException { BufferedReader in = new BufferedReader(new FileReader(posFname)); in.readLine(); String …

Member Avatar for chaos123456
0
634
Member Avatar for jrlynch1

Hello! I am working through some program to auto-print files to a post script printer via the LPR command. The entire program is running, going through directories, finding the files, then deleting the files. Before deleting the files, though, I added in a section to try and print the files …

0
76
Member Avatar for bigbags911

import java.io.*; import java.util.*; public class Reverseing { public static void main(String[] args) throws Exception { File f = new File("backwards.txt"); Scanner finput = new Scanner(f); String sentence = "", s = "", r = ""; while(finput.hasNext()) { sentence = s + finput.nextLine(); } ArrayList<String> lines = new ArrayList<String>(); ArrayList<String> …

Member Avatar for bigbags911
0
2K
Member Avatar for ceyesuma

Hello I am trying to figure what kind of code that would be needed to add a JTabbedPane to an JInternalFrame. I have 7 tabs added now (as many as I need) they are added by simply adding(hard coded) the "text name" to an array and every time the program …

Member Avatar for ceyesuma
0
88
Member Avatar for Dayana Raju

Does anyone know how to put an Image in a Box Layout...just beside the buttons....Pls post me the code if anyone knows it?

0
27
Member Avatar for tones1986

Hey guys, I am trying to store a varying number of coordinate points in an array. So i thought of a list, and declaring this list as an arraylist using the Point class. Make sense so far? Or am i incorrect already? In doing so i came up with this: …

Member Avatar for tones1986
0
4K
Member Avatar for CelestialDog

Hi guys, I've hit a problem I'm hoping someone can help me with. I'm trying to create a little irc bot application, just to learn how to use sockets in Java. Everything works fine so far up to the point where I try to pass the data coming from the …

Member Avatar for CelestialDog
0
116
Member Avatar for handrews3583

I have to write a program using accessors and mutators and a constructor that stores a savings account's annual interest rate and balance. The class constructor needs to accept the amount of the savings account's starting balance. The class needs to have methods for subtracting withdrawals, adding deposits, and adding …

Member Avatar for sfeinst
0
876
Member Avatar for chouki

hello I'm trying to make a program that allows you to return and calculate the shortest common supersecuence using dynamic programming. The basic ideas of supersecuence common Shortest to search a given set of strings for example L, the smallest chain, which is one for each string supersecuence L. the …

Member Avatar for chouki
0
73
Member Avatar for Amu_anu

we r making an image viewer for our mini project....n we hav tried doing it on our own ..but we are able to show only 1 image ...how to show many images using say 10 images in database?? we want functionalities like easy preview of next / previous image from …

Member Avatar for jephthah
-2
100
Member Avatar for shar88

is there any sample of java topological sort algorithm based on minimal vertex method. I also need to implement the ADT graph using adjacency lists representations

Member Avatar for dsmush
0
111
Member Avatar for codiction

This particular snippet will display a chessboard in a new frame. Needless to say save it in a file named "chessboard.java".

Member Avatar for mundvawala
0
1K
Member Avatar for kelvinyap828

basicallt i want to make a simple quiz...and the quiz contained 20 questions...but i have no idea in looping the question...so can anyone help me? [CODE]import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.Random; class Quiz extends JFrame implements ActionListener{ private JButton submit,next; private JTextArea text; private JTextField answer; private JLabel …

Member Avatar for stultuske
0
128

The End.