35,618 Topics

Member Avatar for
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
501
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
196
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
433
Member Avatar for Mysquldata
Member Avatar for Kelly Burby
0
107
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
193
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
98
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
113
Member Avatar for pooran.c

Hi All, I have a JSP which contains a form , when the form is submitted the control comes to servlet . this is working fine in IE. but in google chrome it going to error page . When i debugged from the develper tools , i found one difference …

0
124
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
153
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
383
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
235
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
281
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
111
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
255
Member Avatar for Kert

public Set<Product> getProductsByPriceFilter(Map<String, String> filterParams) { Set<Product> products = new HashSet<Product>(); String l = filterParams.get("low"); String h = filterParams.get("high"); BigDecimal floor = new BigDecimal(l); BigDecimal ceil = new BigDecimal(h); return products; } I have discovered an interesting phenomena. I have filterParams that should <String, String>. However, if I use filterParams.get …

Member Avatar for newcoder310
0
357
Member Avatar for samantha2015

Advice please: Which of these 2 methods looks better ? like professional code? Both methods are doing the same thing(simpleUpdate). Except the way am passing the parameters are different. The method manageJob is used to call the method simpleUpdate to update the status in DB. public <T> void manageJob(Class<T> entityClass,String …

Member Avatar for jwenting
0
211
Member Avatar for vickzbrit

Hello, After making a database connection to java, I have been trying to populate my JTextFields and having a hard time to do so. Can anyone give me a quick example of what class or method am i suppose to use in order to get the results? After that my …

Member Avatar for Tri Setya
0
6K
Member Avatar for shahera.arafat

hii ^_^ I have a problem which is I have to delete a book when( I enter it's name and then press the delete button) and that book has been saved as an object in an array of list, and then written to a (txt )file.. once I press the …

Member Avatar for shahera.arafat
0
222
Member Avatar for hadisur_rahman

# PLEASE some one help me to explain the code. This code is for a ScientificCalculator # package calculator; import java.math.*; //@author Hadisur Rahman public class ScientificCalculator extends javax.swing.JFrame { private boolean zerodisp; private boolean decdisp; private boolean dgrrad; private boolean sh; //sh means =shift private byte op; private double …

Member Avatar for stultuske
0
326
Member Avatar for shahera.arafat

hi :))) I want to ask about sth wich is > I have to write a programme using netbeans ..which I'm new with it ! that programme should let the user to enter the book name ,serial num. ,price ..etc in text fields , and I have buttons that let …

Member Avatar for JamesCherrill
0
276
Member Avatar for newcoder310

Is it better to log `exception` or `exception.getMessage()`while logging an info log or an error log. I'm pretty sure that is related to the context but I'd like to know from a technical perspective on which would be better for any application or if its all the same.

Member Avatar for JamesCherrill
0
2K
Member Avatar for centenond

So im doing an MMO, i was progressing alot, 6 months progrramming this thing. The problem is that i was testing offline my game, today i have the brilliant idea to port foward my server and make it online, i knew it was gonna be slighty slower, but its awful! …

Member Avatar for centenond
0
304
Member Avatar for newcoder310

I recently faced a problem when I was trying to run a junit test in eclipse. I was getting a ClassNotFoundExcpetion. So, I googled a bit and tried out a solution where I had to move the JRE System Library below the rest of the jars and it worked!!! But …

Member Avatar for peter_budo
0
264
Member Avatar for Aditya0025

hi, i want to attach a handwritting pad(ivista tablet) to my java project. Any suggestion or any method how to make it possible. I tried the google but doesn't find any help

Member Avatar for rproffitt
0
232
Member Avatar for altjen

the process cannot access the file because it is being used by another process java I use this code to transfer a file to an other Files.move(Paths.get(file_picker1.getText()), Paths.get("random location\\.png")); I understand that I have to close it. but Im not finidng how to do that. search in google but no …

Member Avatar for JamesCherrill
0
1K
Member Avatar for samantha2015

I want to reduce the number of if statement in my code. I need some advice on how to do this. I have a simple form, when I click submit, it trigger a workflow for approval process. public void initiateWorkflow(){ //some code here //workflow is started } Next, when the …

Member Avatar for samantha2015
0
2K
Member Avatar for altjen

Im having a problem with updating data in SQLite this is the full code who execute after pressing the button try { PrintWriter writer = new PrintWriter("d:\\"+LBL1.getText()+"\\"+TL3.getText()+"_"+TL2.getText()+"_"+TL4.getText()+"_"+TL5.getText()+"_"+TL1.getText()+".txt", "UTF-8"); writer.println("Invoice Number = "+TL1.getText()); writer.println("Seda = " +TL3.getText()); writer.println("Date = " +TL2.getText()); writer.println("Documental Class = " + TL4.getText()); writer.println("Status = " + …

Member Avatar for stultuske
0
920
Member Avatar for divinity02

hi james remember I told you that i have another program for you to help me with, well here it is something is wrong again with my calculation. i have debug it, run through and but still cyah see it. double gross_sal , netpay , hrswrked = 0, rate_of_pay = …

Member Avatar for JamesCherrill
0
202
Member Avatar for hwoarang69

I am using eclipse, Java, and seting up Ajax-DWR. When I run my program nothing happens. I belive This is cause by warning in my xml file. I tried looking on google but didn't found any thing. ## files Path, jar files, etc...: ## Take a look at the attached …

Member Avatar for JamesCherrill
0
384
Member Avatar for DeanMSands3

tl;dr: Looking for a java library to solve equations. Suggestions welcome. I'm looking to write an app for the sake of writing an app. I figured that, as a firmware guy with minimal EE hardware training, a good practice app would be one that acts as a helper for EE …

Member Avatar for DeanMSands3
0
2K

The End.