32,199 Topics
| |
The program is suppose to run through a list of strings. The stings are then put through a hash function (which works fine) and then "hashed" (for lack of a better word). The index is suppose to be an array of linked Lists to handle collision problems. I guess the … | |
Hi, I have 4 classes , 1 is the base class and the other inherts from it, it worked fine when compiling .. I tried to make them as a package , it works fine with the superclass but it doesn't with the other classes, It always gives me cannot … | |
who can I read the RUN ? Hi to all . I now start learning the java language . I have this program : [CODE] import java.util.*; class WTime { public static void main(String[] arguments) { GregorianCalendar now = new GregorianCalendar(); int hour = now.get(Calendar.HOUR_OF_DAY); if (hour < 12) System.out.println("Good … | |
Alright, well I am getting the ".class expected" error. I cannot figure out what it is nor is google helping much either. [code] public class Driver { public static void main (String[] args){ Scanner scanIn = new Scanner(System.in); Deck deck = new Deck(); Card[] hand = new Card[5]; Shuffle shuffle … | |
I always love to learn programing via Music/video players once I grasp the basics. How easy it is to do it, especially using windows DLLs or even Java libraries :) Thanks | |
i am having trouble putting together all the pieces of the puzzle to work together in harmony. My final project is simple,i have a jlabel with the question of how much does your dog weigh, I have a button and a jtextfield, the user enters the amount of there dog, … | |
I have a poker game that mostly works. When I run the program, the players only get Flush and Straight Flush hands. [CODE=syntax] public class Card { private String face; private String suit; public Card(String cardFace, String cardSuit) { face = cardFace; suit = cardSuit; } public Card(Card c) { … | |
I did make some attempts to search for this problem but was not sure exactly what to search for and being after 1AM my eyes wouldn't take reading through the 11+ pages of unrelated search results, so I will just ask the question... New to Java, want to use one … | |
| Hello, I am using Blue J, I have 3 classes, time, date and patient. When I run the patient class, I can put patient details like name, address, DoB, time. The time and date classes are separate classes, how can I store the date (int) and time which I enter … |
I made a poker game and when I run it I get these errors... [CODE=syntax] Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at PokerGame.Hand.getPairs(Hand.java:82) at PokerGame.Hand.whichHand(Hand.java:28) at PokerGame.DeckOfCards$1.actionPerformed(DeckOfCards.java:67) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236) at java.awt.Component.processMouseEvent(Component.java:6263) at javax.swing.JComponent.processMouseEvent(JComponent.java:3267) at java.awt.Component.processEvent(Component.java:6028) at java.awt.Container.processEvent(Container.java:2041) at java.awt.Component.dispatchEventImpl(Component.java:4630) at java.awt.Container.dispatchEventImpl(Container.java:2099) at java.awt.Component.dispatchEvent(Component.java:4460) … | |
hi, ive got a final year project to do. its lik monitoring if any data leakage is happening on the network/system. would like to enquire if is it possible to do such a system using java? thanks. | |
Hey Everyone, I am seeming to be in a spot of trouble. I am using the following code to read a HTML page, loop through it line by line. problem is it is around 7300 lines and takes about 20 seconds to finish the loop. I was wondering if anyone … | |
Hi. I need some help. Below is given a snippet of Java code. [code=Java]deptList = new JList(deptName); add(new JScrollPane(deptList)); deptList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); deptList.addListSelectionListener( listSelectionListener); } ListSelectionListener listSelectionListener = new ListSelectionListener() { public void valueChanged (ListSelectionEvent e) { if (e.getValueIsAdjusting()== false); callback.tell(dept[deptList.getSelectedIndex()]); } }; [/code] When you run it, it creates 2 windows. … | |
I am consuming a webservice which takes in 10 parameters. The aim of the call to the webservice is to obtain a Task ID.All the parameters for the call are supplied from a JSP page(using JSF). The following is the web service call [CODE] return mySoap.addTaskToProject(ticket, projectId, srcLangId, tarLangId, componentId, … | |
[code] package squishgame; /* * The player class allows for a player to be created with: * a name * a location on a grid (0-10, 0-10) * * The player can move North, South, East, or West but will not move off the * grid (must stay within (0,0) … | |
i have a problem in a java program. : "accept a number and print the sum of digits." can anyone help me out??? | |
hi, i receive an error on this line -- if (salesPersonsName <! "end") -- error : operator ! cannot be applied to java.lang.String what can i do? thanks | |
How do you write a driver class? i've never used one before and its sort of dropped into the spec of this program. It uses public static void main(String[] args){} right? i have 4 other classes, so what should i do? | |
Hai Friends, Am programming in java swing, am using scrollane with scrollbars, i want to move the scrollbar at the middle of the panel at starting,am used setvalue but it not setting the given value. please reply me the solution for this problem. | |
So my code does everything I want it to do with the exception of when writing to storage I am not sure how to make true and false write as 1 and 0 respectively. I do not know if it's my syntax or my placement within my program...Kind of lost … | |
Dear JavaFans, I notice that if you use FileOutputStream and FileWriter to write a string into a textfile (.txt) , the Java i/o implementation doesn't seems to recognize the syntax \n which is the newline function. Anyone facing the same problem? The output text file will simple display all strings … | |
Hi guys, Firstly, thanks for the great community, have been lurking for a while and have picked up a lot of help from existing threads. I am making a small program which takes some inputs as strings, i then need to display a list of these inputs, be able to … | |
[code] package squishgame; /* * The stop watch class will allow a program to start and stop a stopwatch as * well as return the stopwatch as a string, a total ms's, or the hour, min, and * seconds separately. * * The System.currentTimeMillis() returns the number of milliseconds since … | |
Basically, this program checks if a word (String s) is a palindrome and prints out "true" if it is and "false" if it isn't. I am currently getting three errors: "unexpected type" at line 17, "incompatible types" at lines 30 and 32. [CODE=java]/** * @(#)palindrome.java * * * @author * … | |
Hi all, I want to make plugin.Pls tell me steps of making plugin in java.Thank for any answer. | |
I have been working on this for a bit, and I have made some great strides. However, there are just a few things bugging me that I can't seem to figure out. This is an assignment, and I don't expect anyone to toss out an entire program for me. However, … | |
I need this to try every ables[z] and the move on to another check. How can i check if its finished without finding the right word in the ables against the other array. Or if its finished and has found the word. [code] for(int i = 0; i < array1.length; … | |
i am trying to send a file using tcp on the local host itself but not sucessful. here iz the program tht i am trying to use. server side [code] [import java.lang.*; import java.io.File; import java.io.InputStream; import java.io.FileInputStream; import java.net.Socket; import java.net.ServerSocket; public class FileReceiver implements Runnable { private static … | |
How can i insert a decimal point into either an integer or a String(probably a String), 2 decimals from the right? like with money? eg/ 13922 139.22 |
The End.