35,618 Topics

Member Avatar for
Member Avatar for jjonesmu

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 …

Member Avatar for Ezzaral
0
1K
Member Avatar for john2342

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 …

Member Avatar for javaAddict
0
80
Member Avatar for msr

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 …

Member Avatar for msr
0
102
Member Avatar for senormateo2011

[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. …

Member Avatar for charlieruns
0
829
Member Avatar for hsncvs

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 …

Member Avatar for hsncvs
0
3K
Member Avatar for whoadiz

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 …

Member Avatar for cale.macdonald
0
135
Member Avatar for yohanus

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 …

Member Avatar for masijade
0
322
Member Avatar for Ghada Ibrahim

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 …

Member Avatar for Ghada Ibrahim
0
2K
Member Avatar for sweetgurl

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; }

Member Avatar for sweetgurl
0
80
Member Avatar for sam8

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 …

Member Avatar for sam8
0
3K
Member Avatar for sweetgurl

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 …

Member Avatar for sweetgurl
0
130
Member Avatar for anjaliua

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 …

0
29
Member Avatar for sennat_26

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 …

Member Avatar for javaAddict
0
147
Member Avatar for ubi_ct83

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" }; // ----------------------------------------------- …

Member Avatar for javaAddict
0
64
Member Avatar for m.sagar1990

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 …

Member Avatar for sennat_26
0
79
Member Avatar for Bobon

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 …

Member Avatar for JamesCherrill
0
85
Member Avatar for BuhRock

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 …

Member Avatar for wolstaneye
0
119
Member Avatar for sennat_26

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 …

Member Avatar for sennat_26
0
3K
Member Avatar for poojagupta02

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 :(, …

Member Avatar for masijade
0
81
Member Avatar for tien113

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 …

Member Avatar for tien113
0
2K
Member Avatar for ceyesuma

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 …

Member Avatar for masijade
0
194
Member Avatar for Jeun

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 …

Member Avatar for Jeun
0
236
Member Avatar for white feather

[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 + " …

0
60
Member Avatar for white feather

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] …

Member Avatar for white feather
0
83
Member Avatar for nickwl23

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 …

0
21
Member Avatar for malugirl4

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.

Member Avatar for malugirl4
0
78
Member Avatar for sam8

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 …

Member Avatar for sam8
0
472
Member Avatar for sam8

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 …

Member Avatar for sam8
0
462
Member Avatar for jnthn205

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 …

Member Avatar for moutanna
0
109
Member Avatar for nwalser

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, ..., …

Member Avatar for BestJewSinceJC
0
1K

The End.