32,199 Topics
| |
Hello everyone! I'm currently having a problem with my program it doesn't loop properly please help me with it. The code is below. Thanks in advance! import java.util.Scanner; import javax.swing.JOptionPane; import javax.swing.*; public class Wewe{ public static void main(String[]args){ Scanner inp = new Scanner(System.in); boolean tryAgain; do{ System.out.print("\nInput username: "); … | |
I want to count the number of times the button is clicked using GUI. I did this code: private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { int clicked = 0; clicked++; System.out.println(clicked); } But it showing the output "1", each time I click the button. I want every time I click the button … | |
package tamirnfasle2; import java.util.Scanner; public class Tamrine4 { private int number; Tamrine4(int n) { number=n; } public void Calculate() { float sum=0.0f; for(int i=1;i<=number;i++) { i=1/i; sum=sum+i; } System.out.println("Sum Reverse Number Between [1," + number + "] Is :" + sum); } public static void main(String [] args){ Scanner inputNumber … | |
Hey everyone, I just need a little help with a lottery program I have to make or class. I have to generate a 7 digit number and then using that number compare it to a guess the user enters. I need to award prizes for the following conditions. 1. if … | |
It's surprisingly how little documentation `java.io.InputStream` has for a class of its complexity and importance. Almost every Java application uses it in one way or another, but how one uses it correctly is not completely spelled out. Naturally the documentation allows most of the methods to throw an `IOException` if … | |
HI all, I am a bit confused about right justifying and formatting strings and numbers in general, and I was wondering if somebody can clarify this for me please. Ok, so let's take an example: // Fig. 7.2: InitArray.java // Initializing the elements of an array to default values of … | |
Hello everyone, I am trying to make a chat application. For this i have made two programs-SERVER and CLIENT. But these are connecting. import java.io.*; import java.net.*; public class SimpleServer { public static void main(String args[]) { ServerSocket s=null; try { s=new ServerSocket (6666); } catch(IOException e) { e.printStackTrace(); } … | |
hello.. can someone show me how to view html code inside pdfptable using itext | |
hi.. I'm trying to read a .docx file using apache poi api methods.. But i'm facing a few problems.. Can anyone suggest me the changes to be made in this code?? package apiole; import java.io.*; import org.apache.poi.xwpf.extractor.XWPFWordExtractor; public class Apiole { public static void main(String[] args) throws IOException { File … | |
I am calling a Stored Proc in Oracle using Hibernate. Procedure: create or replace procedure GetStocks(email in VARCHAR2) is BEGIN execute immediate 'SELECT * FROM stock WHERE email=email'; END; Java Code Query query = session.createSQLQuery("CALL GetStocks(:email)").addEntity(Stock.class).setParameter("email", "abc@xyz.com"); System.out.println("QUERY:"+query.toString()); System.out.println("QUERY SIZE:"+query.list().size()); List result = query.list(); for(int i=0; i<result.size(); i++){ Stock st … | |
Hello. I wrote a program and loaded a lot of data : dir,files,serialized frame etc. I used it and found updates to add so I changed the class so to speak by making the changes. Now of course the same serialized frame will not open so I can not access … | |
Need some assistance with this program. Don't know what I need to do. import java.io.*; // Needed to open and modify binary data public class FileEncryptionFilter { public static void main(String [] args) throws IOException { // An array to write the file int[] numbers = { 2, 4, 6, … | |
I am trying to figure out the best way to approach this..... I am creating a grocery line simulation using a queue, and I know that I will want to create a Customer class that has the information for serviceTime. I am weak on creating classes, what I want to … | |
Hello ! I'm developing a WebApp using [this example](http://www.primefaces.org/showcase/ui/datatableRowSelectionByColumn.jsf) where I: 1. Connect to MySQL and download data. 2. Populate dataTable with downloaded data using. 3. Fetch(view button) the record and display its details in a dialog. Problem begins when I download the records and click on the viewButton(no matter … | |
For example let's say we have the property called Customer that returns a value of name String name; <== Global Variable public String getName() { return name; } public String setName(holdingName) { name=holdingName; } and a constructor called Match public FullName(String realName) { holdingName = realName; } Can I do … | |
im having trouble displaying the 10 most common word pairs. im sure it is just a matter of sorting and taking the data but i am unsure on how to do this? private static void generateOutput() { for(Entry e : result.entrySet()) { System.out.println("Symbol: " + e.getKey()); Map<String, Integer> count = … | |
So here's my code. I had to do 3 constructor and 2 division methods. I have finished the 3 constructors. My question is on the division, where :(1) I have to divide a fraction by an integer and return, (2)divide an integer by a fraction and return. public class IFraction … | |
hi everyone..can u please help me with my project? server to client quiz using java... please.. i really need it.. | |
Hello Im having problems removing the ALT+0160 character from a string. iswhitespace doesnt seem to work. How can I manually remove it? | |
im learning some algorithms , and trying to come up with a version for Quick find using union find. the algorithm works like : 1. get user input for size of the array (the array holds the data on which quickfind will work) 2. create and initialize the array based … | |
Hi, I'm planning to join in a new company as a Java Developer. I have few months of experience only. However, I'm planning to tell the company that I have 1 year of experience. Because in the company they don't consider people who have less than a year of experience. … | |
//compute percentage for Parent1 DecimalFormat df = new DecimalFormat("#.##%"); rs = s.executeQuery("SELECT " + "(SELECT COUNT(*) FROM genetic.blood_type where diseases = '" + disease1 + "')" + "/COUNT(*) AS rowcount FROM genetic.blood_type where btype = '" + btype1 + "'"); rs.next(); int result = rs.getInt("rowcount"); rs.close(); out.println(disease1 + " is … | |
hi ... i want to send to MMS/SMS from PC(mobile phone connected via Usb cable ) to any mobile number at remote side using [B]GPRS[/B] connection. this is a one module of my Final year project. please any one know any library in JAVA or C++ who works this, kindly … | |
Hey everyone, I have been assigned to create a recursive maze program and I am having trouble to figure out how to start it. I am pretty much lost and confused and don't know what to do. I do not want anyone to complete it for me but giving me … | |
i have to create a DigitsDisplay application that prompts the user for a non negative integer and then displays each digit on a separate line like such "Enter a positive integer: 789 7 8 9 so far i have int num; c.print ("Enter a postive number: "); num = c.readInt … | |
hello everyone i'm trying to create algoithm for binary search in multi dimensinal array i have done it on one dimensinal and changed some things but still there is something wrong here's the code i hope you can help public static void binarysearch(int [][] numbers,int searchedvalue) { int lowrow = … | |
Write java program to do the following: Write a METHOD to input an array of type LONG that stores the value of all the powers of 2 from 0 to 63 (i.e. 2^0 to 2^63 ) Output the contents of the array screen (what happens if you try … | |
Hi all, Im writing a program, that takes the a, b, and c from an equation, and uses them to find x using the formula: [http://www.purplemath.com/modules/quads/qform01.gif](http://www.purplemath.com/modules/quads/qform01.gif). The problem im getting, is that when I plugin the equation 1x^2 +3x +4 I get x = -Infinity and x = infinity instead … | |
hi i create a jsp and a servlet to get data from the data to be displayed in the jsp page. the code is below ListCustomer.jsp <table id="customerListTable" border="3"> <tr > <th bgcolor=>ID</th> <th bgcolor=>Name</th> <th bgcolor=>Address</th> <th bgcolor=>TelNo</th> <th bgcolor=>Req</th> </tr> <c:forEach var="customer" begin="0" items="${requestScope.customerList}"> <tr> <td>${customer.cusid} </td> <td>${customer.cusname} </td> <td>${customer.cusaddress} </td> … | |
how to do POS tagging in java netbeans7.0.1 applications? |
The End.