35,618 Topics
![]() | |
I am making a Pong game and I am having trouble making the paddles move. I have already drawn them onto my content pane and I want to use a key listener to make them move. I have heard about using key binding, but I do not understand the tutorial … | |
Hi, i need a like bit of help on understanding how this code actually works. this program basically encodes files, but can someone tell me what these three methods actually do in short detail? [CODE]import java.io.*; import java.util.*; public class BWTEncoder { private int _blockSize; private byte _block[]; private BZTableEntry … | |
Hello, I would like to have a PriorityQueue whose elementes are instances of different subclasses. For example: Event is an abstract superclass. Event1, Event2, Event3 are subclasses. Xpto<> is an interface and PriorityQueueXpto<> is a class that implements Xpto and extends PriorityQueue. [CODE]Xpto<? extends Event> a = new PriorityQueueXpto<????>();[/CODE] Is … | |
[B]Redo the Lucky Sevens dice-playing program so that it uses dice objects. That is, design and implement a Dice class. Each instance of this class should contain the die's current side. There should be an accessor method for a die's current value. The method roll is the only mutator method. … | |
Excuse me if it is a silly mistake but i am newbie to java and couldn't figure it out. Basically it searches if txtText (text area) contains the txtSearchParam (text field) and returns the number of txtSearchParam in txtText. Algorithm is working. simply i can't access variables defined in main … | |
Hey guys, trying to create a binary search tree (BST) and I dont know why but the program is not reading my insert method? When I am testing it, it shows that I did insert the number, yet when I do a check to see if the tree is empty … | |
I keep geting the following errors for my code while compilling can any one give me some dirrection on wha i have done wrong? C:\Documents and Settings\Mark Standerfer.DESKTOP\My Documents\Inventory2.java:117: class, interface, or enum expected System.out.printf("\n\nItem Name: %s\n",s.getItemName()); //display item name ^ C:\Documents and Settings\Mark Standerfer.DESKTOP\My Documents\Inventory2.java:118: class, interface, or enum … | |
Hello , I really need your help! i created a textbox in a jsp page , but i want its value to change using another JSP page without using a submit button in the second page , i need it automatically if a certain condition applies.. Pleaaaase can anyone tell … | |
i want to use a for loop in a function but error occur.. why?? public double weight( double d) { for(int i=0;i<5;i++) { d[i] /= 24;} return d; } | |
Hi guys, I'm trying to count the comparisons in the mergesort algorithm so that I can compare it to other sorting algorithms. I've managed to get a count function to work for insertsort but mergesort is being a complete pain! It's probably a very simple problem but I've experimented around … | |
i want to passing a data from a method but in array.. some error occur like array required but double found and incompatible type.. i don't know how to do it..help me anyone... example: [code]public double getFood(Date date, double AA, double BB, double CC) { }[/code] [code]// below is in … | |
hiii am currently trying to use owl api to load an ontology from protege and use reasoner to query it.I was able to load the ontology but craeting reasoner it showed null pointer exception error.Could sumone help me with the code?can anyone give me a code for loading reasoner and … | |
hi all, thanks for viewing this post.. i have a java constant class for label and button [CODE]public class ButtonConstant { public static final String EXIT=ButtonConstant.getString("BUTTON_CONTENT"); private static String getString(final String key) { System.out.println("inside buttonconstant"); return new LocaleHelper().getString(key); } } [/CODE] here the button content is the key which is … | |
Hi and thanks for viewing my thread, i have a problem with JComboBox. in my situation, i have a code that display JTextArea and JComboBox. this is my code: [code] public class JScrollPanes extends JApplet { //-------------------------------------------------- static String[] t_value2 = { "2", "3", "4", "5", "6" }; // ----------------------------------------------- … | |
hi...... i am working on network Monitoring project.[I] am facing lot of problems in 1)getting the api's (functions) for particular feature.. where can i get those api's for my project.... 2)I am trying SNMP api to work on the project which is in package src,com,sun,jmx,snmp but when i try to … | |
Hey lads. Doing a while loop question but am having a little difficulty with this question. I thought i knew enough to get questions like this correct but unfortunately not experienced enough. The following code is attempting to get sum of values in array that are less than 10. When … | |
Im writing the demo for my class to demonstrate each method. The class takes a number and assigns it to a month, or is supposed to. I have it working to say month 1 is January, month 2 is February and so on. I want to user to enter a … | |
Hi, Im currently in a situation to get all the application name that is currently running in windows but i can get only the processes that is currently running using the following code Process p = Runtime.getRuntime().exec("tasklist.exe /v "); Can anyone help me out in getting the application name... Thanks … | |
Hi, My requirement is to covert the .DOC file to .PDF with the [B]proper formating [/B] using java or in Web Dynpro Java. I have already tried to POI to reading the doc and iTEXT for converting to PDF but the problem is this scenario doesnot maintain any formating :(, … | |
hi, i have some problem with my project, can u help me??? I google but no solution found...:( I used hibernate, strust 2 and spring to manage transaction. I want to try catch username in New.java, username is a PK, this pape throw can throw excetption error but the server … | |
Hi My program is trying to load properties but it is saying it can not read a line of it. Does anyone have an idea why not? [code] dbProperties.load(dbPropInputStreasm); [/code] but error [code] Exception in thread "main" java.lang.NullPointerException at java.util.Properties$LineReader.readLine(Properties.java:418) at java.util.Properties.load0(Properties.java:337) at java.util.Properties.load(Properties.java:325) error here -------> at model.dao.DerbyDAO.loadDBProperties(DerbyDAO.java:160) at … | |
import java.awt.*; import java.awt.event.*; import java.text.*; import javax.swing.*; import javax.swing.border.*; import java.util.Arrays; import java.io.*; public class BankAccount extends JFrame { // Make these variables publicly available String file = ("THUS.txt"); public static String acctNumber ; public static String custid , acctDateOpened; public static double balance ; private static final String … | |
[CODE] String test = "for (int i = 55; i < 60; i++)"; String line = ""; String replace = " Tester." + "n" + Tester.counter + ";"; Pattern p = Pattern.compile(reg); Matcher m = p.matcher(test); if (m.find()) { String s = "public static double n" + counter + " … | |
ok, so i have this [B]so far [/B] [CODE] String p = "(http|ftp|https):" + // sees if the proto is any of these " (\\:[\\w^\\:]+:)? " + // gets the sub-proto " \\/\\/" + // the two forward slashes "([\\w*.]+)" + // gets the subdomain(s), domain and tld "[\\:\\w*^"; [/CODE] … | |
Hi experts, I have done a very simple snake game but there are some error.. I would like to make it continue with 3 lifes before game over but I fail. Did any1 can help?? Here is the code: import java.awt.*; import java.awt.event.*; import java.applet.*; import javax.swing.*; import javax.swing.JOptionPane; import … | |
I am working on this programming probability assignment for class and I am having trouble figuring out how to work this problem below. 1.) Design and write a computer-based simulation to find an empirical probability for landing on GO TO JAIL/Boardwalk. | |
Hi guys, I'm trying to count the comparisons in the mergesort algorithm so that I can compare it to other sorting algorithms. I've managed to get a count to work for insertsort but mergesort is being a complete pain! It's probably a very simple problem but I've experimented around with … | |
Hi guys, I'm trying to count and time the comparisons in the mergesort algorithm so that I can compare it to other sorting algorithms. I've managed to get a count and stopwatch function to work for insertsort but mergesort is being a complete pain! It's probably a very simple problem … | |
Here is an example of the return statement in question: [CODE]public boolean either24(int[] nums) { boolean n1 = false; boolean n2 = false; for (int i=0;i<nums.length-1;i++) if (nums[i]==2 && nums[i+1]==2) n1 = true; else if (nums[i]==4 && nums[i+1]==4) n2 = true; return !n1 && n2 || n1 && !n2; //<----what … | |
The board game scrabble works by assigning points to wooden tiles arranged in cells on a board. It's described here:[url]http://en.wikipedia.org/wiki/Scrabble[/url]. We'll simplify this considerably, and consider the following question. We begin with the letter-scoring scheme from Scrabble: a = 1, b = 3, c = 3, d = 2, ..., … |
The End.