32,199 Topics
| |
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 … | |
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 … | |
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 … | |
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 … | |
# 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 … | |
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 … | |
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. | |
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! … | |
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 … | |
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 | |
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 … | |
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 … | |
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 = " + … | |
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 = … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 | |
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 … | |
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 … | |
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. | |
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 … | |
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[] … | |
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. | |
this is the code I create to import pics select image: JFileChooser chooser = new JFileChooser(); chooser.showOpenDialog(null); File f = chooser.getSelectedFile(); filename = f.getAbsolutePath(); file_picker1.setText(filename); try{ File image = new File (filename); FileInputStream fis = new FileInputStream(filename); ByteArrayOutputStream bos = new ByteArrayOutputStream(); byte[] buf = new byte[1024]; for (int readNum; … | |
Hi can someone help me to solve this problem : Create a program that would compute the grade of a student. This would ask for the name of the student, the overall total of written test, performance task and quarterly assessment. Afterwards, it would for the total score of the … | |
can anyone explain the meaning of Void in java..even though i referred many books,not able to understand clear as i am a learner.. | |
As part of a class in Java, the constuctor is supposed to throw a java.lang.IllegalArgumentException exception when an integer that is a field in the class, let's call it int N, is set to a negative vale. How do I set this up? | |
Respected members, I have this code chunk that should read multiple text files from a folder. I am later calculating their probability. For one file it is working fine and methods are also showing output. The first code is for ONE FILE named as English.txt. BufferedReader reader = new BufferedReader(new … |
The End.