35,619 Topics
![]() | |
I recently left Python behind to pick up Java. In Python, a variable defined in a function could not be called outside of the function. But you could at least let the function return a value, which could be a variable defined in the function. When a variable is defined … | |
Hi, I have a external class with paint(Graphics g) method and the class itself is working great. I can get it visible by launching it from my launch class by doing add(new Laatikko()); but when I am trying to get it work from third class it wont show up. Basicly … | |
public class QueueAsArray implements Queue { protected int[] myArray; int count, size, rear = 0; public QueueAsArray(int newSize) { myArray = new int[newSize]; size = newSize; count = 0; } public void purge() { int index = 0; while(count > 0) { myArray[index] = 0; index++; count--; } rear = … | |
when i call the function as System.out.println("Hi..."+i+"Welcome"); where i initialized the value of i as i=50; when this statement is executed, how that function is called... is it called in the way as Sop("hi..."); Sop(i); Sop("welcome"); **please help to understatnd the working..* | |
For my final project I have to develop a functional flowchart and write a menu-driven Java program, using control constructs and user-defined functions. My question is, what the heck is a menu-driven program? | |
hey guys i found a cool java app that helps me manage my svn directories, you can find it by following this link: http://just-download.com/software-development/other/svncontrol-1.62.zip/12a97 i was wondering whether this is an open source and whether i can get a source code for it as i would like to extend it … | |
//ArrayListEx(main class) import java.io.*; import man.Phone; import man.Person; import java.util.*; public class ArrayListEx{ public static void main(String[] args){ Person p= new Person(); p.setName("yo"); ArrayList<Phone> pList = new ArrayList<Phone>(); Phone ph = new Phone(); ph.setOne("dasd"); pList.add(ph); System.out.println("sgs "+pList); } } My Program has a Person,Phone and ArrayListEx(main class) classes,Person contains an … | |
when i use following code i do not get correct output: In this the function maxHeartRate returns an Integer value.Lets take it equal to 199. public String targetHeartRate() { double a = maxHeartRate()/2; double b = ((85/100)*(maxHeartRate())); String c = a+"-"+b; return c; } Using above code i get String … | |
Suppose I want retrieve values froma table that are greater than 10, should I first store all the values in a list and then check condition of ">10" using any language or should I just just retrieve all values directly from databse using query : `Select id from table where … | |
So i have a working network file transfer program now (if you want to see some of the code look at my other '[article](http://www.daniweb.com/software-development/java/threads/426357/networking-in-java-not-doing-it-right)'). But now that im trying larger files, im running into a problem where i run out of memory (which is understandable when the array is 1 … | |
Hi all I need to put a program on the server that frequently get data from the web and update the database with these data and this program should do this automatically. Can anyone put me on the Beginning of the road. I read in some websites about servlet context … | |
Hi everyone, I am trying to pass the X and Y values that are in class Chart onto class NodeAvg, but cant come up with the code to do that.Any help appreciated: package Testing; import java.awt.Color; import java.awt.Paint; import java.io.IOException; import java.util.ArrayList; import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; import org.jfree.chart.plot.DrawingSupplier; … | |
ok hey guys i have a application in vb with a textbox 2 buttons and a web browser, button1 is for navgating the web browser through what is entered in textbox1 button2 is for inserting the javascript : javascript:document.body.contentEditable='true'; document.designMode='on'; void 0 however when i clickthe button i just get … | |
This same code run good on windows 7 32 bit Problem happen when i run it on windows 7 64 bit error : database is locked... public void genTablehadir() { tblKehadiran.setAutoCreateColumnsFromModel(false); m_data = new Kehadirantable(this); tblKehadiran.setModel(m_data); tblKehadiran.setRowHeight(23); //inisialisasi int m_Jalokasi=0,m_kode=0; Boolean m_alokasi=false; String[] parsePeriode; String m_npk="null",m_nama="null",m_ket="null",m_id="null",m_flagE="null",m_flagP="null",m_cekhk="null",m_ceksts="null"; try { db.createMasterConn(); rs1 … | |
I know how the ++ operator and -- operator works.This is my code to count the no of digit in an integer and it works perfectly. import java.util.Scanner; public class modified_sepadigit { public static void main(String args[]) { Scanner input=new Scanner(System.in); System.out.println("Enter a number"); int no=input.nextInt(); int noOfDigit=0; int tempNo=no; … | |
hi, i need a jsp code fordisplying a second form(form2) when i click a submit button. plz help me. | |
I have a written code on a simple address book which allows addnew,view single entry and view all names. I have added the delete functionality to allow one to enter name to delete its entry but I get Error: [B]cannot find symbol return addressBookEntry.delete(); symbol:method delete() location:variable addressBookEntry of type … | |
hello friends.. i want your hep.. i m searching for a mini project in java.. so please suggest some project titles to me..waiting for your reply.. thanks take care rajesh | |
hi im doing my B.Tech IT i wish to do a real time project so i need help regarding of what i can do as a project some ideas regarding that, also any website i can refer for the idea . I chosen my domain as JAVA... | |
If i create an object in Class1 and save some data in that object in Class1, how can i access that same data in Class2? Here's a code sample that should clarify my situation: Class1.java: public class Class1 implements Runnable { public ClientArray ca; public Class1(int port) throws IOException { … | |
In a previous thread i had described a problem i had to transfer a frame or panel and all it's components as an image into a buffered image. I thought i had found the solution but it seems i am doing something wrong. In line 162 i call the method … | |
hey all iv have an assignment(wrtie an employee payroll program) which iv seen alot of other people have posted about so sorry for bringing it up again but im stuck. Iv made the program and it runs fine but it always calculates grosspay and netpay as 0.0 everything else (firstname … | |
Hey all, I need to get a design going to parse some XML files, in the past i have used XStream to parse files, however it doesn't appear to be working in this case. Here is a sample of the generated XML i'm trying to parse: <debugging level="0" /> XStream … | |
Hi ! I'm devloping a Personal Trainer app on android and I need to remember training results in a history. I decided to remeber this results in a XML file. WHAT I HAVE: is an User class with results class User{ String name; int result1; int result2; User(String name, int … | |
> Hey guys! good evening! > hope you can help me with this one. > this is the thing that i want to do!: > > -Input 2 values : 1 string, and 1 int > -the string should have only letters (cant contain numbers!) > -encrypt the string using … | |
Hi. i was wondering if somebody could help me. Im looking for a php function to check a get and post methods for any type of hack or injection i.e. xss php java html mysql injection. the function needs to check the get or post methods prior to using it … | |
I am working with CSVfile program. I have already calculate something from it. Name,Age,Sex,Pincode,Disease 1. aaa,4,M,35265,flu 2. bbb,4,M,35652,Gastric 3. eee,6,F,35265,Brain 4. sss,7,M,32564,flu I have made program for calculating no. of age,sex and pincode as attached in the code. In this i have calculated that age=4 comes how many times and … | |
I got error of ArrayIndexOutOfBounds Exception in following code. Please help me to how to solve the error.I also used String tokenizer class. import java.io.*; import java.lang.*; import java.util.Arrays; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.Reader; import java.util.StringTokenizer; public class CSV{ public static void main(String[] … | |
Hey, i googled around for a solution but seem unable to come up with a reasonable solution to the problem of passing a class as a parameter. I wish to mimic the syntax used in java like below : setPenColor(new Color(255, 0, 255)); Where i can pass a new object … | |
I need help with Cartesian coordinates: Write a Java interface named Centered with two abstract methods with no argument: one named getCenterX that returns a double, and another named getCenterY that returns also an double. The purpose of these two methods is to return the two Cartesian coordinates of the … |
The End.