31,001 Topics
|
|
Hello, I am evaluating a string expression using recursion. It is not working for parenthesis, please help me. Here is my code // For Addition and Substraction static int evalAS(String e) { int p1 = e.lastIndexOf("+"); int p2 = e.lastIndexOf("-"); int p = Math.max(p1, p2); if (p == -1) return … |
|
Hi, I'm trying to make a label visible by clicking on a button. The following code will make the label visible, but will disappear in less than a second. I'm assuming its because the form is getting submitted in the java script, so the page is getting refreshed? Is there … |
|
Sort numbers random in array import java.util.*; class FillAndSort { public static void main( String[ ] args ) { if ( args.length != 1 ) { System.err.println( "java FillAndSort <number of doubles>" ); return; //*** exits main and, therefore, the program stops } int n = Integer.parseInt( args[ 0 ] … |
|
I have problem to understand threads. Can someone help me to know how i can do rest of this program. Here is program text first: The program will read a file where the first line contains the number of words in the rest of the file, one word on each … |
|
We are creating a work-flow in which a submitted form-data needs to be approved by dynamic number of people based on the designation of user who submitted it. So if User1 has submitted a form and there are 3 levels in between, before it goes to final approver Uuser5, the … |
|
Hi everyone :)))) there is a problem here !this code should draw a rectangle whenever I presse on the mouse ! but actually it doesn't do that !! when I execute the prog. it gives me the frame window ! but when I presse the mouse ,it should draw a … |
|
Help, I have a good pseudocode written that is supposed to get the title of a person and how many boxes in an order and print labels. Here is the pseudocode, please help. start Declarations string title string firstName string lastName string streetAddress string city string state num zip num … |
|
I am trying to execute the query on server side and send the result to the client but at the time of returning the value to the client the error occurs Am trying to achieve this using RPC Protocol but i could not find out how to send back the … |
|
Hello All, I am trying to implement a program that takes a prefix expression/string and converts it into a postfix string. I looked up the general algorithim for this converson and tried to implement it myself into this program. The following code is taken from my main java file. My … |
|
my code is as follows: class pottertr_Point{ private String name; private double x; private double y; public pottertr_Point(){ name="Org"; x=(0); y=(0); } public pottertr_Point getPoint(){ pottertr_Point p= new pottertr_Point(); p.name=this.name; p.x=this.x; p.y=this.y; return p ; } public void setPoint(pottertr_Point p){ this.name=p.name; this.x=p.x; this.y=p.y; } public void setName(String name){ this.name=name; } … |
|
I have recently been writing some code that asks the user questions about german. br = new BufferedReader(new FileReader("C:\\Users\\Patrick\\Desktop\\Java Workspace\\germanTool\\src\\germanTool\\lesson1.txt")); String[] engList = null; String[] deuList = null; int i = 0; while (br.readLine() != null){ lineCount++; line = br.readLine(); engList[i] = line.split("\t")[0]; deuList[i] = line.split("\t")[1]; } Using this code … |
|
hi guys j is there a way on how to analyze java snippet of codes, like for loops, while loop to check to see what will be the result of it, whether it would run, what results, or if it would give you any kind of syntax error, run time … |
|
Create a class to represent a Book. A Book should have a title, author, edition, and number of pages. Choose the most appropriate types for each of these and make them private. Provide set and get methods for each of the instance variables. Also, create a toString() method that returns … |
|
Hello, I try to rename file or directory using JFileChooser() and JButton(). But it gives me a NullPointer exeption. I have FileChooser, Button and TextField where I write new name for my file or directory. Can you say where I go wrong and how to solve this problem. // button … |
|
Hi, I'm trying to find a creative project for my Java Mini Project which has to be done this summer. I just cannot find satisfaction with most of the projects in 1000projects.org or any other website. I'm looking for a project which is moderately heavy to code and can be … |
|
hi guys, j how are you all doing, i havent been here for a while, anyone miss me, jus kidding anyway i am trying to build this program, it is just a practice thing but I am getting this error and havent got a clue how to make it work … |
|
How does a person go about adding an item to a queue within a gui? I have a textarea and a textfield. |
|
hi ^_^ I want to write a code to set an (error) text in the Jtextfiled if the number contains more than 1 dot (eventHandling)! but my code actually didn't concatinate with the next digits I've enterded ,for example:(2. ) and stop ! so what is the right solution ?!! … |
|
hi everyone :) I have a problem here >>which I can't add 2 numbers >> and I don't know what is the solution for that !!>>it always gives me an empty result !and that is because (num2) always parse a (null) value ! so how can I edit the value … |
|
I'm painting a grid on the JPanel and trying to scroll the grid with a JScrollPane. I have a feeling the scrollpane is getting the actual size of the panel, instead of the size including what is not being shown. Something along those lines at least, I can't quite wrap … |
|
Hello Everyone Im trying to call my paint method inside my ball class but cant seem to get it to work.Repaint wont call paint nor update Any help would be greatly appreciated public class Bounce2 extends Applet implements ActionListener,AdjustmentListener, Runnable { //Create and initialize objects private static final long serialVersionUID … |
|
I have a GUI with two JSpinner's and a Spinner Model attached to each of them. When changing one value, the other changes. I suspect this is because I'm using the same model. This is obviously not what I intend to do, is there a better way than creating another … |
|
Hi! Straight to the problem: I'm building this server application which will monitor SQL databases. I want it to remember any number of connections so I've made a few methods which I thought would do the trick, except they don't. The program should add any new SQL connection to a … |
|
Hi guys I need help creating an unordered list of objects.I am supposed to create a file of name and phone number pairs, such that each name is on a separate line and each phone number is on a separate line. Then I am to edit the Phonetest and phone … |
|
Hi, Im slightly stuck with a java project ive been asked to do. The problem is the game is a simon game so I the computer picks a letter randomly and the player has to copy it, if the player picks the wrong letter in the sequence the game informs … |
|
i am working on an infix to postfix project and have reached a troubling point. one by one i must extract a string token from the string being inputted to the method infixtopostfix and one by one input them to the front of the deque named postfix. i dont understand … |
|
How can I sum only the first and the last item in an array list? ex.: list = (300, 450, 150, 800, ...) |
|
So, I've written a Custom Binary Format outline but I'm not sure how to translate it to code. I was looking for a few tips on where to get started? Here's my outline. MAPDATA { signature // U24 0x4D, 0x41, 0x50 (MAP) version // U8 0x01 width // U16 (MAX … |
|
Hi, Guys. I'm calculating the correlation coefficient between two HashMaps of Stock Prices keyed on Dates. However, the Dates do not always line up perfectly. So, I need to line-up the two HashMaps by their Keys. Thus far, I'm creating two ArrayLists of the Dates, doing retainAll between them and … |
|
i need to connect my PC to Micro controller through Bluetooth,to make it simple my PC will continuously send string to Micro controller depending upon string micro controller performs task ,can this post will be useful to my problem else can u please guide me? Thanks in advance |
The End.