35,618 Topics
![]() | |
Hey Everyone... Not quite sure how it works on these forums as this is my first post, but I am looking to separate elements of lines printed to a text file in real-time for a log parser. An example of the text output is: [INDENT][CHAT WINDOW TEXT] [Sun Nov 29 … | |
I am attempting to initialize an int[] array of 10 random numbers. Then choose a pivot value from the array. I then place this value in the first position of the array. Then call quicksort on the array, which will call a partition method. This method returns the final index … | |
I have this code: [CODE] public static int pow (int x, int n) { if (n==0) return 1; int t = pow (x, n/2); if (n%2 == 0) { return t*t; } else { return t*t*x; } } public static void main(String[] args) { System.out.println (pow (5, 2)); } [/CODE] … | |
I have two text files which are similar but with different tags: File 1: [code] Ben|2 Jen|4 Harry|8 Bill|3 Jack|2 Jill|2 Rip|1 P|1 A|3 B|4 C|2 G|5 Tom|1 Harr|4 Red|4 Green|2 Red|3 Blue|4 Lent|4 Burrow|2 [/code] File 2: [code] Ben|2 Jen|5 Harry|2 Bill|4 Jack|3 Jill|6 Rip|1 P|2 A|19 B|0 C|1 … | |
Hi, I`m making a temperature program, the program takes the temperature F and prints the equivalent Celcius temperature. and VS. The temperature is a double, but I get too many numbers after the decimal poit, like( 45.67777777...) I`d like to set it to only one or two numbers after the … | |
Hello everyone, I am writing a simple program for homework that processes the users income taxes. Part of the assignment is to allow the user to process a second user if they desire. My problem is that when the user elects to go ahead with round number two. The program … | |
I've created a simple GUI that's purpose is to square or cube a given number that the user enters into the textfield. This all works fine but what I now want to do is to fine-tune it by testing the input. For example if the user enters a non-numerical value … | |
Hi how can i get linux distributions name in java ??? i try it by Syatem.getProperty("os.name") but this return only "Linux" !!! is any way to return like fedora , suse , ... ??? thanks | |
Hi guys!! i have 2 list box and a button. The first list box has 3 items on it, letters a, b and c. What I need to do is when i select a and c, and then pressed the button, the items selected would be transferred to list box … | |
Ok I am writing a program that has to use for and while loops. This program will have to output a list of even numbers between 1-100. Is this program correct I wrote or what does it need? public class loops { public static void main(String args[]){ var x = … | |
Currently, I have a jsp that lists all files in a directory and subdirectories in a web page. The problem that I encounter is that when I navigate to files 2 or 3 subdirectories deep, the resulting web link adds erroneous spaces to my address. These spaces are making the … | |
Hey I'm trying to create a simple Vigenere cipher table like this in Java... [url]http://cairnarvon.rotahall.org/pics/tabularecta.png[/url] I'm doing it for fun but have literally been staring at this code for days now without any brainwaves! If this isn't the right forum, let me know, if you can figure out why the … | |
Hi I want to return a value from shell script to java code? That value may be a file name or any string. Is it possible? If yes, then how to do it? Can I get any steps or API's for that. Thanks Abhay | |
hey guys, i have to do this program and i'm having trouble with prompting 2 things outside the loop. Write a program that lets the user enter the loan amount and loan period in number of years and displays the monthly and total payments for each interest rate starting from … | |
I am in a class and am trying to get this project done. I get the code to compile but it is giving me a out of bounds error. Here is the assignment. Write the program in Java (without a graphical user interface) and have it calculate the payment amount … | |
hey guys.. basically i'm writing a program that will let the user enter an int and the program will insert that that value in to a double-link-list(dll) along with calculating the sqr root value of it in that same node and it's inserted to the node by increasing int value … | |
I need to write a program that will output a list of all even numbers between 1-100. It needs to use a while loop then use a for loop. Any one got any help on how to do that? | |
I am attempting to execute a unix "df -k" command in java. I have the following example.. My question is how do I parse the results of the command in order to grab the available bytes versus just printing it out???? import java.io.*; public class unixcmd { public static void … | |
I am trying to create a program the checks the frequency of letters in a string but when i run the program it doesn't work right? Any suggestions for how i can fix this? import java.util.*; public class LetterFreq{ public static void main(String[] args){ String[] lines = new String[50]; Scanner … | |
How can I do this? FILEOUTPUTSTREAM and FILEINPUTSTREAM provide code that will write bytes to file and read them back | |
I have a hyperlink column in a datagrid that uses DataNavigateUrlFormatString to open a popup window via javascript. I am trying to get two variables from a sql to show in the query string for the popup window. I am able to pass the sessionstart date which is ={0} but … | |
Hello fellow seniors, i can display all the data from array after i input all the data, but do not know how to display it on displayDonor() Any help is highly appreciate. [CODE]import javax.swing.JOptionPane; public class DonorMenu{ public static void main(String args[]) { int choice = -1; do{ choice = … | |
How can I Define a JFrame subclass that has four vertically positioned buttons. The labels for the four buttons are Senior, Junior, Sophomore, and Freshman. When a button is clicked, display a message that identifies which button is clicked, using JOptionPane. | |
![]() | I want to create an array of the object student, and be able to add a student, delete a student and change the student attributes. Please help. I need to add and do all these things using an interactive user input (Scanner). here's the student class i created. [CODE=java] public … |
I am currently doing project where i need to let user mark portions of any inputed image. The markings could be in different shapes like square, rect, circle, irregular etc. I should be able to remember the markings and later on reproduce them on the same image when asked to. … | |
everytime i try to append a new object to file it just over rights the whole file this is the code im using to add a new object to the file: [CODE] public void add1() { FileOutputStream fos = null; { ObjectOutputStream out = null; try { fos = new … | |
i am saving some records in an excel file on click of a button currently i am hardcoding the path like [CODE]FileOutputStream fileOut = new FileOutputStream("c:\\test.xls"); [/CODE] but i want to take the path from user,i.e.,something like 'save as' option how can i do it? please help. Thanks in advance. | |
Hi, first time poster here, but i'm having some troubles with a project i'm working on. I'm not in need of a solution, just some pointers to get me going? I have a GUI which is a text editor for a programming language. Basically, i have all the functionalities of … | |
Hi, im a total Java beginner and was just hoping someone could help me work out why i'm getting an 'illegal start of expression' error on the first line: (public boolean isFull()) of this code: [code] public boolean isFull() { for (int a = 0; a < 10; a++) { … | |
Hai Friends. I want to use payment gateway in my j2me application, is there any way to process payment gate, if please , help me. |
The End.