35,618 Topics

Member Avatar for
Member Avatar for Member 784374

Hi all, I was wondering if any of you could tell me how to convert a date format that is being returned in my XML. The element content is being returned as a string of form "2010-11-16T09:00:00Z". The XML is a copy of some metadata of an object in my …

Member Avatar for JamesCherrill
0
92
Member Avatar for gedas

hey guys, i am working on coordinates in one program and there is a line such as this one: [CODE]int xx =Math.round((int) getWidth() * 100 / 768);[/CODE] can somebody tell me what calculation is actually taken before the value is set to int xx thanks a lot for any suggestions

Member Avatar for gedas
0
155
Member Avatar for Codeslinger

/*THE OUTPUT SHOULD BE LIKE THIS: 2 4 6 8 10 - 30 //gets the sum of first column 12 14 16 18 20 - 60 //gets the sum of second column 1 2 3 4 5 - 15 //gets the sum of third column 6 5 4 3 2 …

Member Avatar for apines
0
94
Member Avatar for Monkey-huh?

[CODE]import java.util.*; public class Sort { public static void main(String[] args) { //driver method int[] array = new int[10]; System.out.println("Please enter ten integers"); insertionSort(array); } public static void insertionSort(int[] array) { Scanner kybd = new Scanner(System.in); int min, temp, n = array.length; for (int i = 0; i < n; …

Member Avatar for masijade
0
104
Member Avatar for serph09

Edit: Oh, nvm. I just redid the code and figured out how to write the tester class. Sorry guys for the trouble:( This thread can be deleted. So I have this code (not all was written by me). But I don't know how to start writing a tester class for …

Member Avatar for javaAddict
0
165
Member Avatar for rony

Hiya, I am using following Java file which creates a GUI, in the input field if i put any character why dont I see the JOptionPane.showMessageDialog pop up window as mentioned in the code? Any clues? Thx Rony //import statements import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import java.text.DecimalFormat; …

Member Avatar for javaAddict
0
756
Member Avatar for blknmld69

I would like to know how to take a selected Item string ("Allen Hall: $1,500 per semester") from one combobox and another selected Item string ("7 meals per week: $650 per semester") from another combobox and have the output to be ($2,150) the total of the two strings added together?

Member Avatar for javaAddict
0
107
Member Avatar for koushikroy1989

Hi all, I want some inputs from you on the following issue. I have two drop downs on a jsp page.On the selection of the first drop down the page will get refreshed and the second combo box will be loaded regarding the selection of the first drop down. Now, …

Member Avatar for javaAddict
0
142
Member Avatar for soteri0s

Hello everyone, I know this question has been asked before but it is possible to write a keylogger in java? Before assumptions are made I'm not trying to hack anyone or do anything illegal. I simply have a team project in my data structures class and I am an aspiring …

Member Avatar for peter_budo
0
239
Member Avatar for serph09

I have these three classes: Student.java [CODE]public class Student { private int grade; private String name; public Student(String n, int g) { grade = g; name = n; } public int getGrade() { return grade; } public String getName() { return name; } }[/CODE] GradeBook.java [CODE]public class GradeBook { private …

Member Avatar for ~s.o.s~
0
126
Member Avatar for oneml

Hi I am trying to create a program in java which will scan for words within a text file. The program will scan the list containing a bunch of words in every line some words may be repeated. The program should scan the text file when I input a word …

Member Avatar for ~s.o.s~
0
175
Member Avatar for raul8

In the code below I've to use Pre-built DatabaseManager which has limited exposed functions. Now I want to fetch resultset of query that gives country names. [CODE] DatabaseManager dbhandler = new DatabaseManager(); String query = "Select country_names from Country_Table;"; Vector vResult = dbHandler.getResult(query); //getResult returns Vector [/CODE] How can I …

Member Avatar for kalpanakovuru
0
199
Member Avatar for sri.k

Hi all, This is sri. I've done some program to read xml elements in java.But i didnt get them in a structured way like root element and its name and child elements and their names.I am getting end tag names after tag value also.so pls help me in getting elements …

Member Avatar for sri.k
0
181
Member Avatar for Codeslinger

PLEASE MODIFY MY CODE TO COMPUTE FOR THE AVERAGE OF FIRST GRADING, SECOND GRADING, THIRD GRADING AND FOURTH GRADING PERIOD, THE FORMULA IS THIS AVERAGE COMPUTATION First Grading Period: Average = Sum of grades / Number of subjects Second Grading to Fourth Grading Period: Average = (30% of the Average …

Member Avatar for apines
0
204
Member Avatar for muncher10

I need it to read all three of the numbers and up them back least to greatest. As of right now all it prints is 0.0 for all 3 and true. How do I get it to not print true and 0.0 and print the acual numbers. [CODE]public class Floating …

Member Avatar for theonly
0
82
Member Avatar for lse123

Exist way to convert page.jsp or page.cfm, (and server side code) to code lines, and append in javamail or cfmail to send this page as embedded to body of email but not attachched??

Member Avatar for lse123
0
48
Member Avatar for incubus9x9

So my teacher gets mad at me when I ask questions so I'm coming here for your help cause you guys a life savers :) OK So what I understand about this project is we have a file with numbers and we have to make an array to read it. …

Member Avatar for kramerd
0
198
Member Avatar for jiraiya

Hi everyone, I'd like to write a small application to basically read in some text from a file, display it in a GUI (I've done this using a textpane), and then change the font color of certain words if they exist in the text (say from the default color to …

Member Avatar for Ezzaral
0
102
Member Avatar for Roy1287

How can I use this but not return FALSE because of decimal in numbers? [CODE]public class isNumeric { // This method checks if a String contains only numbers public boolean isNumeric(String str) { //It can't contain only numbers if it's null or empty if (str == null || str.length() == …

Member Avatar for jon.kiparsky
0
84
Member Avatar for intes77

sub class [CODE] public class Exer2 { public void setLength(int x) { this.listLength=x; } public int getLength() { return this.listLength; } int listLength=getLength(); int list[]=new int[listLength]; public void display() { System.out.println("The array length is: "+list.length+" "); } } [/CODE] main class [CODE] import java.util.*; public class Output { static Exer2 …

Member Avatar for intes77
0
151
Member Avatar for natha_peepli

i just learned how to get input from keyboard...' [CODE] import java.io.*; class Fish{ public static void main(String[] args) { BufferedReader Keey = new BufferedReader(new InputStreamReader(System.in)); System.out.println(Keey.readLine()); } } [/CODE] But whenver i compile it..its shows me the follwing exception.. C:\Program Files\Java\jdk1.6.0_22\bin>javac Fish.java Fish.java:7: unreported exception java.io.IOException; must be caught …

Member Avatar for apines
0
196
Member Avatar for amras123

for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++) if (j = i) table [i] [j] = 1; else table [i] [j] = 0;

Member Avatar for Dhruv Gairola
0
88
Member Avatar for usiyalla

I am getting user input by get method [CODE] out.print("<FORM METH0D=GET action =\"index.jsp\">"); out.print("<INPUT TYPE=TEXT NAME=searchTerm><BR><BR>"); [/CODE] and using request.getParameter() for getting value. [CODE] request.getParameter("searchTerm"); [/CODE] so, if request.getParameter() is null i hide some code of my page as you'll see . But although user not search any item and …

Member Avatar for usiyalla
0
2K
Member Avatar for hanvyj

I'm trying to print at a resolution other than 72 DPI, I managed this using the PrinterResolution (see the code below) but I am having a problem with the printable area. When I change the resolution to 300 DPI I just print everything smaller (ie the getImageableWidth() etc are still …

0
61
Member Avatar for Son of a gun

Evening I am writing a small program to present a UI that when selecting 1 item from a drop down list then gives the user a selection of data relating to their selection. For instance if Ford cortina was selected from a list of Ford cars on screen in the …

Member Avatar for quuba
0
128
Member Avatar for siva87

I am working with jsp web project now.... In that If some user login with their own login id and password, it shoule be redirected to their own home pages... i have already done this.. but if some time their own home page is idle, it should be displayed as …

Member Avatar for siva87
0
136
Member Avatar for hiddenman91

**I make servlet and in servlet we make dropdown menu for display names against id but when we run the servlet drop down menu created but no values displayed form database in dropdown menu so pls help me. sorry for bad english** import java.io.IOException; import java.io.PrintWriter; import java.sql.Connection; import java.sql.PreparedStatement; …

Member Avatar for hiddenman91
0
286
Member Avatar for rincethomas33

i want to create a menu. if i press the menuitem,then a certain action will occure.. and so on... give the details please...

Member Avatar for Dhruv Gairola
0
127
Member Avatar for Tankadin

Hi folks....I have two separate copies of this program to show how my thought process worked in initial creation and how it has changed since I was helped by you folks in my airline reservation program. It does not work but I DID try to apply what I have learned …

Member Avatar for Tankadin
0
733
Member Avatar for MoZo1

Hi! I'm reading COM port from under java. Like: [ICODE]new RandomAccessFile("COM1", "rw");[/ICODE] I know, it looks dumb, I would be more happy with ActiveX too... But I need the ability to adapt to different kind of systems in the future, and COM can be read as file on almost every …

Member Avatar for MoZo1
0
98

The End.