32,205 Topics

Member Avatar for
Member Avatar for djcrab

Hello. I'm hoping someone will be willing to help me out. I'm pretty much done except for one part I've been scratching my head over. I'm sure this headache I have is not helping. Below are the instructions and the code for my problem area. Output the sum of all …

Member Avatar for djcrab
0
246
Member Avatar for supertechnewbie

I tried to make a try-catch block in a program but when an exception occurs, it doesn't do what I intended int num = 0; boolean noException; Scanner keyboard = new Scanner(System.in); while (true) { noException = true; System.out.print("Enter a number or 0 to exit: "); try { num = …

Member Avatar for tux4life
0
146
Member Avatar for StefanRafa0

anyone know how to split the text in txt file i have this... try { String newaccount = NewAccount.getText(); String newaccusername = NewAccUsername.getText(); String newaccpassword = NewAccPassword.getText(); FileWriter filewriter = new FileWriter(newaccount + ".txt"); BufferedWriter out = new BufferedWriter(filewriter); out.write(newaccpassword); out.write(newaccusername); //out.write(newAccount); out.close(); LabelInfo.setText("Account Registered !"); } catch (Exception ex) …

Member Avatar for stultuske
0
203
Member Avatar for StefanRafa0

Every time when trying to build gives me this "The project does not have a build script." what to do ??? :/

Member Avatar for stultuske
0
70
Member Avatar for gsfdg

Please help. I have an illegal start of expression at line 65 where it says "public static void p(Object...args)" /* * To change this template, choose Tools | Templates * and open the template in the editor. */ import java.io.*; /** * * @author Minh */ public class Dna { …

Member Avatar for stultuske
0
231
Member Avatar for iamthwee

Does anyone have a sample fully working code, that demonstrates how to change the mouse cursor picture when moved over a certain area in a program? [edit] just to clarify change it to a mouse cursor I designed myself[/edit] ThanQ

Member Avatar for maquaree
0
618
Member Avatar for hg_fs2002

I am trying to use such a hexadecimal floating constant "0x0.DAB789B" in java but it gives me java.lang.NumberFormatException. How can I convert hexadecimal float constant to decimal? I know how to convert hexadecimal **int** constant but that does not work for float constant.

Member Avatar for tux4life
2
678
Member Avatar for mehmud

Implement in Java a class Coin that describes a coin with a name (e.g. dime) and a value (e.g. 10 cents). Also implement a class Wallet that describes a collection of coins. Supply a method add() to add a coin to a purse, and a method printContent() that prints out …

Member Avatar for tux4life
0
932
Member Avatar for LOI_SE

I'm writing a VB.NET software application in which I want to plot some placemarks on a google map which is in a webbrowser control in the application. weburl = applicationpath & "/googlemaps.html" WebBrowser1.Navigate(weburl) To accomplish this I call a javascript function from VB.net in this button event: Private Sub Button1_Click_1(ByVal …

Member Avatar for TnTinMN
1
1K
Member Avatar for efth

public class ClickListener implements ActionListener { public void actionPerformed(ActionEvent e) { System.out.println(e.getSource().setText("Changed")); } } Eclipse tells me that `setText()` is undefined for type Object. This tells me that `getSource()` doesn't actually return the JButton object. How do should I do this then? How I change the text of the clicked …

Member Avatar for efth
0
17K
Member Avatar for jalpesh_007

I have doubt that what we are using in java as String, is it class or datatype? String str = "hello" String s1 = new String("Hi") What is the difference in above two statements? Which is object of String class and which is varialble of datatype String? Because as i …

Member Avatar for jalpesh_007
0
271
Member Avatar for needhelp88

Hi all, I have created a java program that reads in the number of rows and columns entered by the user, and creates a board of that size. Then, it takes in the position of cells (x, y) that the user wants to make live on that board. -1 will …

Member Avatar for needhelp88
0
254
Member Avatar for Kewne

Hi,... I tried to run the code using the java emulator but it only provides one phone emulator at a time I couldn't see if it does pass the word, what I did is that I downloaded the sun wireless toolkit which can run multiple number of mobile emulator. I …

Member Avatar for Kewne
0
247
Member Avatar for aVar++

Hello I have made a simple program, but I have a problem with my IF...ELSE statement. Il explain under the code. Main Class: public class Learnt { //Main void in Learnt class public static void main(String args[]){ //Ask's user for name then prints it String AskForUsersName = "What is your …

Member Avatar for stultuske
0
187
Member Avatar for shishir365

import java.util.*; class nw { int dis(int p) { int c=0,flag=0; for(int j=1;j<=p;j++) { if(p%j==0) c++; } if(c==2) return 1; } void hui() { int c; int p,q; Scanner sc=new Scanner(System.in); System.out.println("range p"); p=sc.nextInt(); System.out.println("range q"); q=sc.nextInt(); for(int i=p;i<=q;i++) { c=dis(i); if(c==1) { System.out.println(i); }}}} {it says missing return statement! …

Member Avatar for stultuske
0
166
Member Avatar for sofien.fkih

How can I display a color in java with a certain color, Please help with an example.

Member Avatar for Ene Uran
0
115
Member Avatar for london-G

Hello, I would like to build my application which is interacting with my localhost database. In netbeans before I run the program I need to turn on Wamp and "Start all services" in order for the program to run properly. My question is, when the jar file is made, will …

0
86
Member Avatar for Violet_82

Hi there, I have to calculate the pithagorean triplets up to 500 (it's an exercise I found on the deitel and deitel book) and I got a little stuck, in that it looks like I am getting an infinite loop. The exercise says to use a triple for loop, but …

Member Avatar for Violet_82
0
129
Member Avatar for angel06

Hello guys I have a problem in resizing the image in my java program here is the code: import java.awt.*; import java.applet.*; public class sampleCaseStudy extends Applet { private Image MyImage; public void init() { MyImage = getImage(getDocumentBase(), "manginasalmo.jpg"); MyImage.getScaledInstance(700, 100, Image.SCALE_DEFAULT); } public void paint(Graphics g) { g.drawImage(MyImage, 0, …

Member Avatar for bguild
0
125
Member Avatar for vij123

Hello Sir, I have a simple Issue but It is not resolve by me i.e input parameter are not store in Ms-Access. I store the input parameter through Standard Action <jsp:useBean>. jsp:useBean call a property IssueData. this property exist in SimpleBean which create a connection from DB and insert the …

Member Avatar for mahe33
0
997
Member Avatar for noorjan

i have an image stored in the column( img) of mysql table albums. the format is blob. i do not no how to retreive it from the table and display it in a label img1 in my netbeans project. how do i write the resultset code and display it on …

Member Avatar for radhakrishna.p
0
150
Member Avatar for daxx

Recently got a new windows 8 laptop and having trouble using features in eclipse. For instance I can't connect to my local database, can't connect to the eclipse marketplace and even can't run JUnit tests! (Gives a could not connect to error) I believe there is something going wrong with …

Member Avatar for daxx
0
134
Member Avatar for javaid iqbal

public static int findMaxPosition(int n[]){ int i, maxPosition =0; for (i=1;i<n.length;i++) if (n[maxPosition]<n[i]) maxPosition=i; return maxPosition; }

Member Avatar for harinath_2007
-2
110
Member Avatar for pattmorter

Hey everyone, So i've been doing some reasearch and I can't seem to find the answer to my problem anywhere. It could also be that I don't really understand the articles I find in google but I figured I'd ask here since everyone is always so helpful. So for a …

Member Avatar for pattmorter
0
258
Member Avatar for vishalonne

Hi Everybody I tried and failed to display images of employees in jTable. I have a MySQL Table which have 4 fields - ID,Name.Phone,Photo(Blob data type). Now I am able to retrive data from this table and display it in JLabel with other data in JTextField, but How can I …

Member Avatar for stultuske
0
1K
Member Avatar for Kewne

is it going to be possible to have a connection if I create a J2ME (netbeans) as client and vb.net (2010) as the server?

Member Avatar for Kewne
0
228
Member Avatar for awfootball7

I keep getting an error in my MoneyDemo class, it reads, "Method checkMoney in class Money cannot be applied to given types; required: no arguments; found int, int; reason:actual and formal argument lists differ in length" Also here is my list of objectives for the program which I'll be graded …

Member Avatar for gon1387
0
450
Member Avatar for daryl_1201

public class JavaApplication1 { public static void main(String[] args) { for (int i = 5 < = 100; 1 + = 5){ System.out.print(i); if (i <100){ System.out.print(","); } } } }

Member Avatar for stultuske
0
228
Member Avatar for adikimicky

Can any one please tell me how to connect a simple java web application to Oracle10g Express edition? Which driver should I use? Thanks in advance.

Member Avatar for adikimicky
0
194
Member Avatar for VEL Hassan

I am in need of SDK ME development kit for creating Mobile applications using Netbeans IDE 7.1.1. Favour me in this regard. Velhassan.

Member Avatar for peter_budo
0
211

The End.