32,199 Topics

Member Avatar for
Member Avatar for Vinolia

hi.i realy need help am a new beginner in java.so i have been trying to do a code in java that returns the largest counter,refering to my libraries.so i was trying to invoke the method comparTo,so i dont know how to use it to compare all counter arrays so that …

Member Avatar for JamesCherrill
0
248
Member Avatar for Ahmed_62
Member Avatar for JamesCherrill
-1
103
Member Avatar for Tanner_1

My code is getting a small error that is refusing to let me entire code compile. Take a look. //THIS IS ASSIGNMENT 4, MAIN METHOD import java.io.*; //to use InputStreamReader and BufferedReader import java.util.*; public class Assignment4 { public static void main (String[] args) { // local variables, can be …

Member Avatar for JamesCherrill
0
258
Member Avatar for sirlink99

Hello All. I am having 2 problems here with my code. I will start off with the video code first. The video code should capture 20 seconds of the screen at 50fps, however, when I generate it, it generates a 1 minute 7 second video, and I am not sure …

Member Avatar for sirlink99
0
1K
Member Avatar for hwoarang69

I have a file with ints like this. 1 2 3 4 5 6 How to read first int from file? How to read second int from file? How to skip first line and but rest in 2d array? This is what I have so far. I am not sure …

Member Avatar for Stefce
0
213
Member Avatar for EarhawkPH

I'm doing a quiz game using netbeans. I've already done the randomization of questions. The problem is, how do i keep a question from repeating itself? ex: chose correct answer --> questionrandomizer comes in --> next question appears but it's the same question earlier here's my code: package kiddiequiz.scienceforms; import …

Member Avatar for Stefce
0
265
Member Avatar for mjayyy

I have to display the mortgage payment amount and then list the loan balance and interest paid for each payment over the term of the loan but my output isn't changing. import java.text.DecimalFormat; import javax.swing.JOptionPane; public class MortgagePmt { public static void main(String[] args) { int term; //Term in years …

Member Avatar for mjayyy
0
1K
Member Avatar for samantha2015

My entity class: @Entity @Table(catalog = "emp", name = "person") @XmlAccessorType(XmlAccessType.FIELD) public class Person implements Serializable { private static final long serialVersionUID = 1L; /** */ @Column(name = "ID", nullable = false,length = 50) @Basic(fetch = FetchType.EAGER) @Id @XmlElement String id; /** */ @Column(name = "ADDRESS", length = 50) @Basic(fetch …

Member Avatar for jwenting
0
675
Member Avatar for divinity02

hi I am trying to build this game. what i have been trying to build for a long time now. it is a multiplication java game that need random numbers to generate it goes like this difficulty level-easy: this difficulty level easy has 3 rounds. the student must be tested …

Member Avatar for divinity02
0
416
Member Avatar for newcoder310

I have a class where there are a few `static final String` variables that have few values that repesent color values. The class is basically used to get the color values. Is it better to convert this to enum? public class Color{ public static final String GRAY50 = "#808080"; public …

Member Avatar for newcoder310
0
227
Member Avatar for divinity02

hi I am getting this an java.lang.array index out of bound exception: 2 error - I am wondering if this is where am getting it. look it over many times, and I know you all are tired of me but am learning. I like the array but it can be …

Member Avatar for newcoder310
0
271
Member Avatar for Brandon Hatch

I have a problem with a project i'm working on, and I was wondering if it was possible to do what i'm thinking. Basically I have a simple mathematical GUI. I want it to take 2 inputs multiply them and output the answer. I am doing this all through the …

Member Avatar for Brandon Hatch
0
228
Member Avatar for samantha2015

I have an android application where user will input data about car. When they are done, they will press a button to sync their data. That is, on pressing the button it will call a rest webservice (Jersey) to synchronize the data with the server which will store the data …

Member Avatar for stultuske
0
174
Member Avatar for Mysquldata
Member Avatar for Curious Gorge

I'm working on a simple encryption program (for school). It is not currently "homework" just FYI, I'm just practicing the examples in the book. It uses a Caesar's Cipher method (an alphabetical shift). I have not tested this code very much. If something is wrong with it I probably don't …

Member Avatar for Curious Gorge
0
239
Member Avatar for EarhawkPH

**I'm using netbeans btw if you notice the long code for the GUI** I'm doing a quiz game. The questions are randomized. My problem is, the randomized questions do not appear on the questionLabel (JLabel Variable). I don't know what to do. Help? /* * To change this license header, …

Member Avatar for EarhawkPH
0
175
Member Avatar for debee

Hi there, I wondered if some one would be able to put me through with this, as i am a newbie in Java. I have the following text file named dvdifo: *Donnie Darko/sci-fi/Gyllenhall, Jake Raiders of the Lost Ark/action/Ford, Harrison 2001/sci-fi/?? Caddy Shack/comedy/Murray, Bill Star Wars/Sci-fi/Ford, Harrison Lost in Translation/comedy/Murray, …

Member Avatar for JamesCherrill
0
205
Member Avatar for gahhon

String contentType = request.getContentType(); if ((contentType != null) && (contentType.indexOf("multipart/form-data") >= 0)) { DataInputStream in = new DataInputStream(request.getInputStream()); int formDataLength = request.getContentLength(); byte dataBytes[] = new byte[formDataLength]; int byteRead = 0; int totalBytesRead = 0; while (totalBytesRead < formDataLength) { byteRead = in.read(dataBytes, totalBytesRead, formDataLength); totalBytesRead += byteRead; } String …

Member Avatar for gahhon
0
500
Member Avatar for Tanner_1

I need to fix a minor error in my assignment. The prompt is: Assignment #2 will be the construction of a program that reads in an unspecified number of integers from standard input, performs some calculations on the input numbers, and outputs the results of those calculations to standard output. …

Member Avatar for JamesCherrill
0
194
Member Avatar for Tierra

When I run this I get an error, it's like it's not reading the printf and honestly I have no idea what else to do, can someone help me? import java.util.Scanner; public class MyCarPool2 { public static void main (String [] args){ //Declarations final int WEEK = 5, MONTH = …

Member Avatar for rubberman
0
402
Member Avatar for Mysquldata
Member Avatar for Kelly Burby
0
105
Member Avatar for divinity02

hi james/anyone/stultuske I am again trying and practicing my java. I am doing this payroll program which include doing methods and array and have no idea where I have gone wrong again i have debug it but inno me, cant find the error and it is there somewhere anyway here …

Member Avatar for divinity02
0
187
Member Avatar for surya55

Hi All, I have a situation where i need to retrieve parentpath from childname in JFace Checkboxtreeviewer. By using below code, i can get both the path seperately. getCheckedElements() - child elements getExpandedTreePaths() - parent elements How i can map childelements with parent? here i get both seperately. When i …

0
97
Member Avatar for hari_10

Hi All, when i click the save functionality my request is processing and values are stored in database.but the request is coming from chrome browser its not processing and redirected to my error.jsp page.could you please help for this issue.

Member Avatar for stultuske
0
111
Member Avatar for gtel

Noob Question. I need some clarifications with using class as a reference datatype or if you have any links that direct to a straightforward explanation,i'd highly appreciate that. (I had been surfing the net for hours, read some books but the explanation is either vague or just an introduction.)

Member Avatar for JamesCherrill
0
152
Member Avatar for saurabh.mehta.33234

While referring to a particular course I came across the following code to retrieve the current day: int julianStartDay = Time.getJulianDay(System.currentTimeMillis(), dayTime.gmtoff); long dateTime; dateTime = dayTime.setJulianDay(julianStartDay); day = getReadableDateString(dateTime); private String getReadableDateString(long time){ SimpleDateFormat shortenedDateFormat = new SimpleDateFormat("E MMM d"); return shortenedDateFormat.format(time); } My doubt is why are we …

Member Avatar for Taywin
0
379
Member Avatar for Ajay Negi

what are the things a new developer should keep in mind while writing a program? please reply.

Member Avatar for stultuske
0
232
Member Avatar for Rashee

How do i write a simple login page using Java programming language with the following components -JLabel -JTextField -JButton

Member Avatar for stultuske
0
279
Member Avatar for surya55

Hello All, Can anyone provide me the sample program of JFace Treeviewer. As i google it but cant find the right example. Any links with Simple example. Kindly help me out; Thanks in advance.

Member Avatar for Taywin
0
110
Member Avatar for Ojaswi_1

HI guys ..... i m trying to create a search engine through java..... is it possible?? if yes then would you please tell me how....??

Member Avatar for Taywin
0
253

The End.