Forum

Posts

RECENTLY INDEXED PROGRAMMING SOLUTIONS OF Java


try catch help  

Hi I have a situation where i m displaying a menu,then allowing the user to enter an option from the menu (example press1),then using a switch statement (with the cases.)In case 5 I am using try & catch so if the user enters a string instead of an integer, the program tell... Continue Reading
Views : 53
Thursday 25th of October 2012

Need help on Exception  

Output i must get When i type in the Letters i get "Please enter positive integer values only" instead of "Please enter in numbers, not letters"... Continue Reading
Views : 34
Thursday 25th of October 2012

How to extract a jar in java  

I have jar file. how to extract a jar in java. Continue Reading
Views : 29
Thursday 25th of October 2012

Storing a string in StringTokenizer  

Hi, I am going to store a string in string tokenizer. But i am not getting the output what i think. For example : StringTokenizer st = new StringTokenizer("I born on 21.02.1995. So, now my age is 15.", "."); I will get output as : Continue Reading
Views : 41
Thursday 25th of October 2012

Array Question  

I'm trying to put a filter over an image using arrays. For each given pixel, I need to take itself and the 8 surrounding pixels, multiply by the corresponding weights in the "coefs" array, and use the sum to set the new center pixel. So far, I've been able to make arrays for the pixel's 3... Continue Reading
Views : 20
Thursday 25th of October 2012

Problem with the while loop  

Hi, I`m new here (and to Java). Hope I can get some help. :) So I am to write a program that takes as input a year and calculate the Gregorian epact number. For the calculation part, it`s ok. However If the user enters a year which is not of 4-digit, your program must... Continue Reading
Views : 36
Thursday 25th of October 2012

Need help with escape characters  

Hi all, I am have trouble writing a program with escape characters in it. The object of the program is to print out 3 letters a, b, and c. What I have to do is fix all of the letters to get each to line up. However it seems that some of my \t are not getting read in the program and... Continue Reading
Views : 43
Thursday 25th of October 2012

dynamic binding  

Hai anyone can u give me the simple and straight forward example and discription about the dynamic binding and method overridden. Continue Reading
Views : 38
Thursday 25th of October 2012

How to convert a String into an Hexadecimal   

Hi! I have a String which represents a hexadecimal number (e.g. "5FA2"). Ideally, I would like to convert this String into an int (e.g. 0x5FA2), is there a quick way to do this ? I can't use the method "Integer.parseInt()" since my String represents an hexadecimal and... Continue Reading
Views : 48
Thursday 25th of October 2012

Problems while getting data from weblogic server when using connection pooling  

Hello, I am new to database connection pooling. I am using weblogic server, Java 1.6, MySql database. I have done connection pooling in weblogic server. The problem arise when I try to run select query I cannot fetch data in ResultSet. For insert it works fine... import... Continue Reading
Views : 94
Thursday 25th of October 2012

Using JMusic to make Nodes  

Down here is a SoloNode.java code that I am working on. I dont know how to do the last 2 methods, they are: public Phrase collect() public String toString() Java Code: Continue Reading
Views : 77
Thursday 25th of October 2012

Swapping Characters  

This is seriously driving me insane:1) Ask the user to enter a word (this is the password, already figured this part out)> Store it (already figured this part out).> Encrypt it by asking the user to do 5 times the following:>> Ask the user for a... Continue Reading
Views : 15
Thursday 25th of October 2012

Sorting 3 Integers Using If Else  

Im having a little trouble trying to sort 3 integers using if-else statements. An example would help alot. Here is what I've got currently. Thanks import javax.swing.JOptionPane;public class MDS03_01 { //Program for 3 Integers to sort public static... Continue Reading
Views : 22
Thursday 25th of October 2012

Which data structure to choose   

Hello! I need some help about choosing the right data structure for my program. I have a file with a few thoushand of lines, representing properties of characters (1 line = 1 character). There is the unicode, the UTF-8 code, and other stuff on the same line.Now, I... Continue Reading
Views : 33
Thursday 25th of October 2012

browser and links  

Hi Adjusted a browser I found in java - looks cool and works great Continue Reading
Views : 30
Thursday 25th of October 2012

Passing values to main(String args[])   

Hi, I saw some code which appeared to pass values to void main(String args[])and I was wondering how this is done and why it would be done. example: Java Code: public... Continue Reading
Views : 47
Thursday 25th of October 2012

Need help correcting - Newbie don't know what's wrong  

So, hello all. This is my first post btw xD Im a first year Computing student and I got suspended so I can't get any more help from my tutors. But I still do exercises. This one is supposed to be easy but I'm completely lost. I had to develop an application that would store, and... Continue Reading
Views : 68
Thursday 25th of October 2012

Problem to organize my code in classes  

Hi everyone, I'm just confused about how to organize my code. Basically I have a GUI and other methods to load/write data from/into files. For now, I just have one BIG class with everything inside but of course I know it's not that good and I would like to... Continue Reading
Views : 47
Thursday 25th of October 2012

Picking a "IDE"  

Hi, I'm trying to figure out what I should use to do Java stuff. I'm currently using DrJava (LOVE IT). I tried Eclipse and NetBeans, but hate them both (with a passion). I don't like how they create a bunch of unneeded files and folders; all it should have to create is a simple... Continue Reading
Views : 19
Thursday 25th of October 2012

what is natural ordering  

I was up the sort method of the array class for my school project and it says that the sort class orders the objects in the natural ordering. What does this mean? static void sort(Object[] a) Sorts the specified array of objects into ascending order,... Continue Reading
Views : 30
Thursday 25th of October 2012

Installing a new Java Package  

Hi,I have got a new JAVA package from web. Specifically, it is JAMA.Can anyone tell me how I can install the package so that I can use the package's classes etc.? Many thanks!:) , There is a jar file on that page complete with documentation and an example... Continue Reading
Views : 26
Thursday 25th of October 2012

help needed  

hi friends....i am stuck in my code i am trying to assign a value of javascript variable to a java variable but it is giving errors is there any way of doing this.....i searched a lot but found none any suggestion will be highly appreciated Continue Reading
Views : 83
Thursday 25th of October 2012

Command-Line Arguments  

on one example program it says to put a command line argument to see the program run and i dont know where to put it?do you have to write it in the code? Java Code: class YearDisplayer { ... Continue Reading
Views : 16
Thursday 25th of October 2012

Loops and display problem  

Hey all, so new java developer here and I am trying to create a program that will show this to the user. Please enter the temperature you would like to convert - 0Enter 1 if the temperature you entered is in degrees Fahrenheit and 2 if it is in degrees Celsius -... Continue Reading
Views : 32
Thursday 25th of October 2012

Methods  

I am currently writing a code which involves methods. I am currently stuck at step 3. 1.Write a method called findMin2. parameters: three integers3. the method returns an integer which is the minimum of the three ints My first line of code to complete step... Continue Reading
Views : 16
Thursday 25th of October 2012

How to compare char  

Hello I'm trying to read a single character input and then decide what character it actually is. I can only figure out how to read a string input but not just a character input. Also, once I have that character I don't know the syntax to decide if that character is an A or B or... Continue Reading
Views : 35
Thursday 25th of October 2012

Help. Find a word and located sentences in the file  

I want to find a word and located sentences in the file; For example: I love java. It is a programming language. İ am X. Everybody loves JavaFX. Search: java Display: I love java.Everybody loves JavaFX.... Continue Reading
Views : 18
Thursday 25th of October 2012

How to connect to printer from a stand alone java program  

Hi, help me to write a standalone java program, that connect to a network printer(Printer name given). Continue Reading
Views : 78
Thursday 25th of October 2012

Unable to call paint() from inside method  

Java Code: import javax.swing.*;import java.awt.Graphics;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;public class JPanel01 extends JPanel { int xa = 0, ya = 0; JButton... Continue Reading
Views : 33
Thursday 25th of October 2012

Methods  

As some of you saw my other thread creating methods. Well now I have created methods but I am having problems calling for it on the main method. These where the instructions from my instructor on how to create the method.Write a method called convertInchesToFeet ... Continue Reading
Views : 12
Thursday 25th of October 2012