35,618 Topics
![]() | |
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 … | |
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 | |
![]() | /*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 … |
[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; … | |
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 … | |
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; … | |
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? | |
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, … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
![]() | 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 … |
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 … | |
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?? | |
![]() | 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. … |
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 … | |
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() == … | |
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 … | |
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 … | |
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; | |
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 … | |
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 … | |
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 … | |
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 … | |
**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; … | |
i want to create a menu. if i press the menuitem,then a certain action will occure.. and so on... give the details please... | |
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 … | |
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 … |
The End.