32,204 Topics

Member Avatar for
Member Avatar for sariberri

I don't know why I keep getting an InputMismatchException :/ It highlights when I call the load() method. Thanks [CODE] import java.util.*; import java.io.*; public class GradeManager { private ArrayList <Student> StudentGrades; public GradeManager(){ StudentGrades=new ArrayList<Student>(); load(); } public void load(){ Scanner fileIn=null; try{ fileIn=new Scanner(new File("grades.txt")); }catch(FileNotFoundException e){ System.out.print("Cannot …

Member Avatar for kramerd
0
118
Member Avatar for dem10

Hey all, I have some code here for a red black tree that prints out in preorder traversal. The entire program works fine and prints out to a file when I run from the terminal "java Main.java<input1.txt>output.txt", however I need set it up so it writes to standard output "output.txt" …

Member Avatar for kramerd
0
106
Member Avatar for sirlink99

I am wondering if I could write this code to a file and then print it at a starting location (like an image). [CODE] g.setColor(Color.white); g.fill3DRect(en1X + 0 * enZ, en1Y - 25 * enZ, 5 * enZ, 5 * enZ, true); g.fill3DRect(en1X + 5 * enZ, en1Y - 30 …

Member Avatar for mKorbel
0
200
Member Avatar for HelloMe

Hello guys... I have a strange problem on my calculation for a First in First Out Algorithm. The problem is, when i have to calculate 4 processes and above, the waiting time on my processes are wrong, but when i have to calculate only up to 3 processes it is …

Member Avatar for HelloMe
0
101
Member Avatar for rjdelight

Hi all, I'm trying to get the information from a text file to show up in the JTextArea I have in a GUI. I'm using the GUI editor in NetBeans, because I'm a Java newb. I've been reading a lot of things on the web and can't seem to figure …

Member Avatar for sirlink99
0
3K
Member Avatar for gunjannigam

I am using JPQL to write queries. I have an SQL as [CODE] SELECT * FROM `powergenerationdatapoint` AS pgdp INNER JOIN ( SELECT MAX( TIMESTAMP ) TIME FROM powergenerationdatapoint GROUP BY solarpanel_id )maxtime ON pgdp.timestamp = maxtime.time WHERE solarpanel_id IN ( SELECT id FROM solarpanel WHERE solar_plant_id =1 ) GROUP …

Member Avatar for mKorbel
0
95
Member Avatar for gedas

hey, i have created a project in netbeans that contains an applet, later i use that projects jar file in web project and i embed the applet in the html file. the annoying thing is that once i change something in my applet project the and i run the web …

Member Avatar for gedas
0
76
Member Avatar for kandyhyatt

I'm new to java and seriously needing some help..I'm having problems deciding accessor and mutator methods.. and how to create an ArrayList. Write a program that uses an ArrayList of parameter type Contact to store a database of contacts. The Contact class should store the contact's first and last name, …

Member Avatar for kandyhyatt
0
235
Member Avatar for shapam

how can i open .java extension file in jdk software.. i used edit keyword to open the .java file but jdk is not allowing me to open the .java file.. please any one fix this problem...

Member Avatar for stultuske
0
94
Member Avatar for gingerfish

i have this 2d array: String[][] testData= { {"s", "y", "r"}, {"s", "n", "r"}, {"w", "y", "r"}, {"s", "n", "r"} }; how can i count the occurrence of a particular element in the column of an array? for example i want to know how many "s" are in first column …

Member Avatar for gingerfish
0
3K
Member Avatar for joseph.roy9

i hav developed a java swing desktop application in eclipse & ubuntu;From where should i get the jar file of my appication or how to create jar file of my application??? thanks in advance...........

Member Avatar for JamesCherrill
0
203
Member Avatar for sirlink99

Is there a way to diplay a web page like google in an application in a JLabel for example. Kind of like the new minecraft launcher where it shows the update in a window about the login area. Thanks for any help.

Member Avatar for mKorbel
0
76
Member Avatar for keiteqq

if a word begins with a vowel (a-e-i-o-u), then "ay" is added to the end of the word (so "idle" -> "idleay", and "often" -> "oftenay"); on the other hand, if a word begins with a consonant, then the first letter is removed, and is placed at the end of …

Member Avatar for keiteqq
0
496
Member Avatar for Slyvr

[CODE]PointerInfo a = MouseInfo.getPointerInfo(); Point b = a.getLocation(); int x = (int) b.getX(); int y = (int) b.getY(); System.out.print("Y: "+y); System.out.print("X: "+x+"\n");[/CODE] Right now I'm using this, but it gives me the coordinates relative to the entire monitor. Since you can move the program frame anywhere on the monitor, this …

Member Avatar for Slyvr
0
4K
Member Avatar for yo123
Member Avatar for valiandra
0
556
Member Avatar for gedas

hey, i have been trying to sign jar file in order to use my applet to connect to mysql database. i am using netbeans and i have been looking for the turorials how to sign jar file but all of them tend to skip steps and i am not sure …

Member Avatar for Ezzaral
0
103
Member Avatar for SeanC

Hi all, I'm currently trying to solve a problem with a JList. I've got an actionPerformed event applied to the JList (also tried the item updated event but it has the same effect), and whenever this event is fired, (i.e. the user makes a selection), something happens. Now, the problem …

Member Avatar for Ezzaral
0
397
Member Avatar for SMITA6076

I wrote the following method to get the current date for an invoice: [CODE] public String getDate() { DateFormat dateFormat = new SimpleDateFormat("MMMMMMMMM d, yyyy"); Date orderDate = new Date(); return dateFormat.format(orderDate); }[/CODE] but now I have to add two weeks (14 days) to that date (to get the expected …

Member Avatar for SMITA6076
0
921
Member Avatar for lu25

i have a file that contains hexadecimal values and i want to convert them to int how do u do that exactly?? [CODE] import java.util.Scanner; import java.io.File; import java.io.IOException; public class CacheSimulation { public static void main(String args[]) throws IOException { int hexAdd [] = new int [32]; //array to …

Member Avatar for Slyvr
0
176
Member Avatar for 24x24

Hey guys I had some homework in a Java class on Friday. I completed it so I am not looking for answers (I also don't think it will be graded). I was just curious, as a learning exercise, how would you guys improve this and why? Now remember I'm a …

Member Avatar for 24x24
1
180
Member Avatar for Aepexx

So what I'm aiming for here is to take the user's input as float and write code to split up that input into individual digits and use an array. How would I go about doing this? Here is what my code looks like currently: [CODE]import java.util.Scanner; public class Asn8 { …

Member Avatar for FRGT/10
0
229
Member Avatar for madhavipoudala

Hi everyone, i want to know the information about apache activemq which we are using as a broker for sending the messages using jms and websphere server from one server to another server which is the requirement of our project how to send the messages , how to do configiration …

Member Avatar for mKorbel
0
108
Member Avatar for arshi9464

i am designing a small client server system for a hospital, in this system a receptionist will forward the details of patients as they come to the particular doctor, like i go with a problem related to skin disease, my case would be transferred to that particular doc, I am …

Member Avatar for arshi9464
0
161
Member Avatar for D Silent KilLeR

Hi frnds............. I want to implement audio chat feature in my chat server ............ can anybody tell me how to implement it!!!!!!!!!! It's gud if anyone can provide me a small code for implement it..........

Member Avatar for hertze_bogdan
0
116
Member Avatar for HelloMe

Hello everybody...!!! I got a little but bothering problem. I create a First in First out algorithm schedule but somehow i have a problem in computing the WT(Waiting Time). Actually i have a WT but it only considers the current AT(Arrival Time) of the current process and does not include …

0
86
Member Avatar for pooran.c

import java.io.*; class InputDiagnosis{ public static void main(String args[]) throws IOException { char ch; int digit=0; int upper=0; int lower=0; int other=0; BufferedReader inputstream =new BufferedReader(new InputStreamReader(System.in)); System.out.println(" Type some text. When done, press Enter to Quit:"); do{ ch=(char) inputstream.read(); if(Character.isDigit(ch)) digit++; else if(Character.isUpperCase(ch)) upper++; else if(Character.isLowerCase(ch)) lower++; else other++; …

Member Avatar for abhishek20
0
189
Member Avatar for j_kathiresan

Hi, I'm having XML content as a string. I'm using W3C dom for getting values from the XML. I've a very large XML file with attributes, elements similar like below [CODE=xml]<Shares> <bookDetails bookName="How to Learn English" bookAuthor="English Writer"> <Chapter chapterName="From Alphabetes" chapterPage="23"/> </bookDetails> <company> <name>test</name> <address>test address</address> <contact>test contact</contact> <C02>10.5</C02> …

Member Avatar for thekashyap
0
226
Member Avatar for Galois77

Hello All, I have a question related to synchronization in java; there's more like a confirmation. Let's start with the simplified version of my class: [CODE]class MyClass { private List<MyObject> myList = new ArrayList(); public void addEntry(MyObject obj) { myList.add(obj); } public void removeEntry(MyObject obj) { myList.remove(obj); } public double …

Member Avatar for thekashyap
0
194
Member Avatar for spidey32

Hi, im new to this forum and also Java. Im currrently doing my degree 1st year. My lecturer gave me a question on factorial and im unable to solve it. i need to explain why any number of threads can be executing inside of it without causing interference in the …

Member Avatar for spidey32
0
101
Member Avatar for mjavaid

Hi all. How would I modify my current program to make it perform the conversion with the main method calling other methods instead of performing the conversion in the main method itself? I have attached a .pdf file that has a list of all the methods that must be used …

Member Avatar for mjavaid
0
111

The End.