32,199 Topics

Member Avatar for
Member Avatar for angel06

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: "); …

Member Avatar for IIM
0
165
Member Avatar for sofien.fkih

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 …

Member Avatar for JamesCherrill
0
852
Member Avatar for peymankop

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 …

Member Avatar for IIM
0
97
Member Avatar for walkingddeadfan

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 …

Member Avatar for DarkLightning7
0
249
Member Avatar for bguild

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 …

1
130
Member Avatar for Violet_82

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 …

Member Avatar for Violet_82
1
1K
Member Avatar for adikimicky

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(); } …

Member Avatar for adikimicky
0
180
Member Avatar for bipi09

hello.. can someone show me how to view html code inside pdfptable using itext

Member Avatar for peter_budo
0
132
Member Avatar for Vish0203

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 …

Member Avatar for Vish0203
0
284
Member Avatar for Hemanth.Satkuri

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 …

Member Avatar for riahc3
0
362
Member Avatar for cisumma

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 …

Member Avatar for M4trixSh4d0w
0
123
Member Avatar for richard.haines.39

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, …

Member Avatar for richard.haines.39
0
855
Member Avatar for tricket_7

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 …

Member Avatar for bguild
0
780
Member Avatar for hatebin

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 …

Member Avatar for LastMitch
0
213
Member Avatar for xHellghostx

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 …

Member Avatar for stultuske
0
318
Member Avatar for SakuraAssassin

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 = …

Member Avatar for SakuraAssassin
0
173
Member Avatar for kay19

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 …

Member Avatar for M4trixSh4d0w
0
125
Member Avatar for cutiexhubx_1

hi everyone..can u please help me with my project? server to client quiz using java... please.. i really need it..

Member Avatar for M4trixSh4d0w
0
172
Member Avatar for riahc3

Hello Im having problems removing the ALT+0160 character from a string. iswhitespace doesnt seem to work. How can I manually remove it?

Member Avatar for M4trixSh4d0w
0
90
Member Avatar for somjit{}

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 …

Member Avatar for somjit{}
0
186
Member Avatar for ronaldpaul

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. …

Member Avatar for stultuske
0
111
Member Avatar for -acir-

//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 …

Member Avatar for -acir-
0
221
Member Avatar for Ahsan_1

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 …

Member Avatar for poornima2013
0
294
Member Avatar for chonobob

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 …

Member Avatar for JamesCherrill
0
602
Member Avatar for ELMX27

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 …

Member Avatar for stultuske
0
2K
Member Avatar for rami sohaill

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 = …

Member Avatar for rami sohaill
0
219
Member Avatar for michelleruth

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 …

Member Avatar for michelleruth
0
2K
Member Avatar for alek.mieczkowski

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 …

Member Avatar for M4trixSh4d0w
0
246
Member Avatar for anisha.silva

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}&nbsp;&nbsp;</td> <td>${customer.cusname}&nbsp;&nbsp;</td> <td>${customer.cusaddress}&nbsp;&nbsp;</td> …

Member Avatar for LastMitch
0
259
Member Avatar for chitrasuriya

The End.