32,204 Topics

Member Avatar for
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
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
209
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
221
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
321
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
275
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
300
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
261
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
918
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
374
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
Member Avatar for Saboor880

Hello! I am using nebeans ide. I have made two jframes in my project, jframe1 and jframe2. One for login information and one for admin page. My project ran succesfuly i.e when i enter correct information on login page then admin page is displayed. But one problem is that after …

Member Avatar for peter_budo
0
244
Member Avatar for Saboor880

hi. I am using a jList, a button and a jtextfield. I want that the text or string written in jtextfield should add in the jlist on pressing button. But i could not find such method of jlist. Please tell me method of jlist by which i can add items …

Member Avatar for JamesCherrill
0
95
Member Avatar for divinity02

hi james can you explain to me why every time I tried to used this line of code, i keep getting a syntax error. if(code.equals('L') || code.equals('l')) did i miss something, did i leave out someting

Member Avatar for Stephen_8
0
145
Member Avatar for altjen

I have a file set in this folder "C:...../users" (is not real) I want to change the file path with code to set at "D:...../users" how can I do that? I want to change the path of a pic. after import it in database, change her file. how can I …

Member Avatar for altjen
0
247
Member Avatar for Saboor880

Hello to all! I made a small project using Netbeans8. I named my project smallCalcApp. And then i add a new JFrame File in my project and in that file I handled events of components which i put on form. When I run that file , it ran successfully and …

Member Avatar for stultuske
0
350
Member Avatar for Saboor880

hello to all. I have used jdk 7 and now i have started to use netbeans8.0.1 i want to know that how to connect ms acces and sql server database using netbeans. Please send me procedure and sample code to connect to these two databases.

Member Avatar for stultuske
0
92
Member Avatar for kings400

please guys...........how do i go about it, i am writig a project on file compressing system and i am to develop a sofware that would compress files and i have tried using vb.net but i am recieving alot of error messages..i need your help..and what is the best language to …

Member Avatar for stultuske
0
244
Member Avatar for altjen

Im using this code to get image from SQLITE try{ String sql = "SELECT Photo FROM Pics WHERE InvoiceNumber=?"; pst = conn.prepareStatement(sql); rs=pst.executeQuery(); if(rs.next()){ byte[]imagedata = rs.getBytes("Photo"); format = new ImageIcon(imagedata); ImIc.setIcon(format); } }catch(Exception e){ JOptionPane.showMessageDialog(null, e); } `private ImageIcon format = null;` String filename = null; int s=0; byte[] …

Member Avatar for altjen
0
189
Member Avatar for divinity02

Hi j I have a question and I am wondering if it can be answered. the question is, how do you calculate a teaching allowance and nis from the hours of work and rate of pay in java.

Member Avatar for JamesCherrill
0
188

The End.