32,199 Topics

Member Avatar for
Member Avatar for bdl365_1

How do i pass file name ("chosenFileName") from sample2 class to sample1 class? An example would be nice. here's some code from sample 2 class - private void openFile( ) { JFileChooser chooser; int status; chooser = new JFileChooser( ); status = chooser.showOpenDialog(null); if (status == JFileChooser.APPROVE_OPTION) readSource(chooser.getSelectedFile()); else JOptionPane.showMessageDialog(null, …

Member Avatar for stultuske
0
112
Member Avatar for ismail.eyiowuawi

I have two textfields which are formatted for dates, i want to retrieve data from the database within a period of days which the two textfields stand for the "from" and "to" dates.Can anybody help me out? select distinct courseId,courseName,description,Date,amount from course where date>='2013/05/11' and date<='2013/05/11' for the SQL queries …

Member Avatar for stultuske
0
280
Member Avatar for bdl365_1

Let me start by saying I'm a noob. I want to get input from a text file through gui and perform some actions.the last time I did it I used command line argument to pass file name to get file input. The code in quote. It works when I uncomment …

Member Avatar for bdl365_1
0
413
Member Avatar for game06

I am trying to create breakout game like this below. http://www.2dplay.com/break-out/break-out-play.htm I like how when balls bounces on paddle you have control over where it is goings. i need help creating some thing like this //this is my code for when ball touch the paddle(player). i have divide the paddle …

Member Avatar for nandosss
0
176
Member Avatar for greystreet34

Hi, I'm working on an assignment for programming class where we're supposed to create a method that takes the contents from a text file (one giant string) and stores them piece by piece in a linked list. I'm a little stuck and not sure where to go from here, or …

Member Avatar for nandosss
0
4K
Member Avatar for Varunkrishna

When I was going through a program of my friends, suddenly I came across a strange for loop, I was wondering about the for loop since then, the loop looked like this for(1=0,ii=result.length;i<ii;i++) Is this for loop a valid for loop? Can any one please help me?

Member Avatar for JamesCherrill
0
221
Member Avatar for setu basak

package com.example.crypton; import android.app.Activity; import android.content.Intent; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.provider.Contacts; import android.provider.Contacts.People; import android.provider.ContactsContract; import android.provider.ContactsContract.CommonDataKinds; import android.provider.ContactsContract.CommonDataKinds.Phone; import android.provider.ContactsContract.CommonDataKinds.StructuredName; import android.provider.ContactsContract.Data; import android.telephony.SmsManager; import android.util.Log; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import android.app.PendingIntent; public class CREATEMESSAGE extends …

Member Avatar for setu basak
-1
252
Member Avatar for nishad_forums

Hello, I trying to create a **messenger**(just for practice, so nothing fancy!). I created the server and client programs. Suppose a client(user A) initiated a connection with the server, so it's online. Now, another user(user B) wants to chat with that user(A). How do I give User B the IP …

Member Avatar for nishad_forums
0
901
Member Avatar for siblers

Hello, I'm having a bit of trouble with this error. The error seems to be wih setRented but I'm not really sure what to change. This is my interface public interface Rentable{ double getRent(); void setRent (double rent); boolean isRented(); void setRented (boolean rented); } This is my abstract class …

Member Avatar for JamesCherrill
0
180
Member Avatar for setu basak
Member Avatar for harshInITworld

Hi, I am currently working on project wherein I am inserting thousands of records in database using spring batch. So is there any way where I can handle exceptions in my ItemReader and ItemWriter? I need to apply logic for failure of records when job executes i.e if I am …

Member Avatar for JamesCherrill
0
4K
Member Avatar for henrydmainguy

write in java language,to find the maximum,minimum andmean value of asset of floating point numbers to be supplied by the programmer user

Member Avatar for JamesCherrill
0
103
Member Avatar for parkz16

there are no visible error in the syntax but when i run the application i keep getting the following error. i have been trying to fix it for hours and simply cant find the problem. the error that appears when running is; Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at javax.swing.JComboBox.setModel(JComboBox.java:292) at …

Member Avatar for bguild
0
33K
Member Avatar for cisumma

My programs objective is to mkdir and ope dir. if I ever get it jarred up I would like to run it from a jump drive. [code] public static final String USERHOMEDIR = System.getProperty("user.home", "."); [/code] clearly this code will not be valid any more. Could this USERHOMEDIR be replaced …

Member Avatar for cisumma
0
551
Member Avatar for Neon Tetras

I'm working on a Grade Point Average Calculator. The user just have to Select the number of courses offered, then select the grade obtain in the different courses by choosing the appropriate grade from the Choice Box. The problem with my application is that, if the user mistakenly selects "A" …

Member Avatar for Neon Tetras
1
164
Member Avatar for sk8ergirl

hi, how can I make the size of the array is equal to the number of elements in the array

Member Avatar for JamesCherrill
0
262
Member Avatar for aadarsh_khare

Could anyone help me in understanding what does below Python code do? Also please help me in converting it into Java. import random howMany = random.randint(0,1000) stats = {} for i in range(howMany): value = random.randint(0,500) stats.setdefault(value,0) stats[value]+=1 for item in stats: if stats[item] > 1: print item

Member Avatar for JasonHippy
-1
272
Member Avatar for firdousahmad

Asalam U alikum I want to learn Java programming I have installed the jdk7 on my machine and i want to set the environment variables as it shows me that javac is not the internel or externel command.So can anybody help me

Member Avatar for JamesCherrill
0
76
Member Avatar for glao

Hello , I have a List<String> and I want to compare in a loop the elements. For example sth like : for (int i=0;i<theList.size();i++){ while (theList.get(i).equals(theList.get(i+1))) ... } I want to compare the next to the previous entry. Thanks

Member Avatar for glao
0
140
Member Avatar for sushants
Member Avatar for stultuske
0
104
Member Avatar for zxz

Hi everyone , i hope someone helps me out. im working my way up step by step learning Java . but no one at the University is helping , they just give us the homework and we have to learn alone.and give the soltution at the end of the week. …

Member Avatar for stultuske
0
278
Member Avatar for noobCode

Hello. Im new here. I have a question: I have this copy constructor here: /** Copy Constructor. * Since landscape is immutable in the scope of our project, you could * do a simple reference copy for it. * However, Fish and Plants are mutable, so those lists must be …

Member Avatar for stultuske
0
272
Member Avatar for riahc3

Hello Ive come up with a stupid question that just needs a why What would this do? for (int i=5; i<2;i++) { System.out.println("What?"); } System.out.println("Who?");

Member Avatar for deceptikon
0
177
Member Avatar for peymankop

Hi...! I'm Working on a Notepad project and i'm in menu->view->font but i don't have any idea how to write a function for it! can anyone help me?! thanks...

Member Avatar for aVar++
0
88
Member Avatar for game06

i have a enemy and spriteanimation classes. in Enemy class i have bufferedimage array with 4 different images. than i am creating a animation and storing in 'animationEnemyHit' variable. than i am starting and updateing the animation in method. the problem is that it keeps on loop for ever. i …

Member Avatar for gusano79
0
178
Member Avatar for riahc3

Hello This is a demo showing Java interacting with Daniweb's new API ( http://www.daniweb.com/api/documentation ) You introduce a member's name and it should show you the total number of posts he has made. Demo is a proof of concept: No bug checking, error checking, etc is in this code. In …

Member Avatar for peter_budo
4
872
Member Avatar for Cyairak

import java.util.Random; import java.util.Scanner; public class RandomDeck { String suit[] ={"Diamonds" , "hearts" , "spades" , "clubs"}; String face[] = {"A" , "Two" , "three" , "four" , "five" , "six" , "seven" , "eight" , "nine" , "ten" , "jack" , "queen" , "king"}; String cards[] = new String[52]; …

Member Avatar for JamesCherrill
0
141
Member Avatar for mjbor1

hello i am working on a simple panting project that allow the user to select a shap from ComboBox then draw it on the panel but problem is when is choose any type of shapes and drawing it on panel no shape appear on the panel ?! here is my …

Member Avatar for mjbor1
0
305
Member Avatar for Maryooma1

1. Given a length of wire P units long, where P is an integer, it is possible in some cases to bend the wire into an isosceles triangle(with two sides equal) where the lengths of all the sides are also integers. For example a wire of length P = 3 …

Member Avatar for JamesCherrill
0
199
Member Avatar for Dane2259

I once did a project in a class that connected to a mySQL database, but now I'm using the jGRASP ide on a mac and the class files won't compile properly. In the project we added the files: Connection.class, ResultSet.class, Sql.class, and Statement.class to the directory (assuming it's the middleware). …

Member Avatar for jwenting
0
128

The End.