32,204 Topics

Member Avatar for
Member Avatar for kxpatel29

Requirement 1) Modify the code to find and print sum of the same series from 1/2 through 1/n multiple times, where each n is read from data file. Requires nested loop with the inner loop summing up series and outer loop allow inner code to repeat once for each n …

Member Avatar for kxpatel29
0
177
Member Avatar for agent7

hi guys, how can i insert image in a doc file ?? using java... is fileoutputstream can write image? thankz...

Member Avatar for agent7
0
75
Member Avatar for kukuruku

Hi I need help with bubble sort ,Why doesnt work Thanks [CODE] public void printList(){ System.out.print(patientsList.get(0).getFirstName()); for(int i=0;i<patientsList.size();i++){ for(int j = 0; j < patientsList.size(); j++){ for (int b=(j+1);b< patientsList.size(); b++){ int first=patientsList.get(j).getPriority(); int second=patientsList.get(b).getPriority(); if(first>=second){ int temp=first; first=second; second=temp; } } } String fname = patientsList.get(i).getFirstName(); String lname = …

Member Avatar for BestJewSinceJC
0
102
Member Avatar for tracydo

Hi there! So I did this yesterday in class using Grasg, every thing is good. But when i go home and re-do again using JEdit & Terminal cause I'm using Mac. And keep having 1 error that I can't fix, please help! Thx //Lab 2- Find Monthly morgage Payment //File: …

Member Avatar for BestJewSinceJC
0
115
Member Avatar for Torm7311

I am in the process of taking my first java programming class, and this question may be simple for some of you. Here is the question.. Write an application that reads five numbers between 1 and 30. For each number that is read, your program should display the same number …

Member Avatar for Torm7311
0
168
Member Avatar for Progr4mmer

I was watching the java game tutorials by thenewboston on youtube but he stopped making them. Anyone know of any good tutorials for making java 2d or 3d games?

0
74
Member Avatar for Katana24

Im aware of the different data types in java but say if one wanted to have two different types of data in a single array; integer and string, would this be possible? Im aware that java can have an array of each type but I stumbled upon using this and …

Member Avatar for Katana24
0
197
Member Avatar for curbster

Hi all, I have to declare an array of LibraryBook objects and sort them either by title, author or page count, as the user requests. I've got the basics down but I'm missing something. [CODE]public class LibraryBookSort { public static void main(String[] args) { LibraryBook[] myBook = new LibraryBook[5]; myBook[0] …

Member Avatar for jon.kiparsky
0
234
Member Avatar for z00t

implement a class Employee. an employee has a name (a string) and a salary (a double). provide a constructor with two parameters. public Employee (String employeeName, double currentSalary) methods: public String getName() public double getSalary() public void raiseSalary(double byPercent) this is what i have so far: [ICODE]public class Employee { …

Member Avatar for z00t
0
4K
Member Avatar for SaberExcalibur

I have an average knowledge in the whole programming thing but I would really like to excel to this field. I would like to ask our IT professionals and programmers if what books do you recommend me to refer to while learning Books for *Java *advance css,web page *Visual basic …

Member Avatar for jlego
0
187
Member Avatar for StevoLord

Hi All, I am a newbie at java and need some help. I have a JFrame setup where basically I want to show two pictures. I have everything setup however at sleep, timers ect dont currently work and I dont know why. The snipplet of code below should show imagePanel1 …

Member Avatar for StevoLord
0
116
Member Avatar for Harliquin

Ok, so I have to write a program for school that will read data from a text file, split the data (comma delimited) into the correct type, pass that information on to a class, store the class object into an array. This is what I have so far: [CODE]import java.io.*; …

Member Avatar for Harliquin
0
150
Member Avatar for bagichris

Hello All Am having some challenges getting a value in a variable from another class; the code that computes the variable happens to be in a timertask method however if i move that same line of code to the constructor, the second class is able to fetch the value. When …

Member Avatar for Akill10
0
150
Member Avatar for boifang

i have been strugling to identify my error but i have failed to solve the problem my code errors is incompatible types in line 11. [CODE]import java.io.*; public class Appliance { public static void main(String args[]) { try { File file=new File("Name.txt"); FileReader f=new FileReader(file); int ch; while(ch=f.read()) { System.out.print((char)ch); …

Member Avatar for masijade
0
130
Member Avatar for Phatsimo Mosiam

when i write the following code the results tell me that no mainmethods, applets or MIDlets found in file: [CODE]import java.io.*; public class Appliance { NIIT Developing Object Based Applications in Java Assignment A.9 public static void main(String args[]) { try { File file=new File("Name.txt"); FileReader f=new FileReader(file); int ch; …

Member Avatar for masijade
0
61
Member Avatar for haribasker

[CODE]import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.sql.*; import java.util.*; import java.net.*; import java.io.*; import javax.swing.border.*; public class userdetails extends JFrame { private JLabel jLabel1; private JLabel jLabel2; private JLabel jLabel3; private JLabel jLabel4,jLabel5; private JLabel jLabel7; private JLabel jLabel8; private JTextField jTextField1; private JComboBox jComboBox1; private JComboBox jComboBox2; private …

Member Avatar for masijade
0
266
Member Avatar for rhoxart faye
Member Avatar for fugmag

Hello I am trying to get a SELECT stament to work i Java. The staement has a parameter, but Eclipse gives me the following error message: You have an error in your SQL syntax, check the manual that corresponds to your MySQL version...... Is it possible to show me how …

Member Avatar for masijade
0
221
Member Avatar for haribasker

contentPane.setLayout(null); JPanel panel = new JPanel(layout); panel.setBackground(Color.WHITE); addComponent(contentPane,panel, 0,0,595,375);

Member Avatar for masijade
0
8K
Member Avatar for jips11in

THis is program in java for First 100 Prime Number as "count<100" . public class PrimeNumber { public static void main(String args[]) { int num=4; int count=0; System.out.println("First 100 Prime Number is: "); System.out.println("1"); System.out.println("2"); System.out.println("3"); while(count<100) { num++; if(num%2!=0) { int dv=3; while((num%dv!=0)&&(dv<=((num-1)/2))) { dv++; } if(num%dv!=0) { count++; …

Member Avatar for masijade
0
159
Member Avatar for Anuradha Mandal

[CODE]import java.io.*; import java.net.*; import java.awt.*; import java.awt.event.*; import java.awt.geom.AffineTransform; import java.awt.image.*; import javax.imageio.*; import javax.swing.*; class ImageDrawingComponent extends Component { static String descs[] = { "Simple Copy", "Scale Up", "Scale Down", "Scale Up : Bicubic", "Convolve : LowPass", "Convolve : Sharpen", "RescaleOp", "LookupOp", }; int opIndex; private BufferedImage bi; …

Member Avatar for varshakite_21
0
189
Member Avatar for arkaayan

I want to make a java application which'll get all paypal transaction history and the details of each transaction from paypal server and store them into my database. But I can't find a way to retrieve the transaction history from paypal server. I searched the internet and came to know …

0
47
Member Avatar for caswimmer2011

Hi, I have a program that uses JButtons (under ActionEvent e) and the user clicks a button and it brings up the appropriate text file associated with that name. I have the files on a flash drive but every time i transfer the files to different computer and want to …

Member Avatar for caswimmer2011
0
154
Member Avatar for eikal

Hey for hw i gotta do a program that spits out the perfect squares between 0 and a number entered... well i got it done but it spits out 1 extra number that goes OVER what the person entered... here's my code. [code] public static void main(String[] args) { String …

Member Avatar for ztini
0
116
Member Avatar for Hakoo

Hello Friends, I want to synchronize the database from server to mobile application. I googled so much. I got much information on : [LIST] [*]DB2 Everyplace [*]IBM CloudSpace [*]PointBase(Not able to download) [*]Sync4j [*]SyncML [*]Data Sync API(Not able to find) [/LIST] Now I am confused to which one to select? …

Member Avatar for Hakoo
0
171
Member Avatar for kukuruku

Is there method in Java to compare the strings first letter and sort the alphabetical or I have to substring and compare them with bubble sort Thanks

Member Avatar for btsuper
0
142
Member Avatar for Latvija13

I'm wondering if there is a more efficient way to take a 10 character (mm/dd/yyyy) date of birth String and calculate the age of the user as of today's date. My code works perfectly fine, but I feel like it could be more efficient. [CODE] package dates; import java.util.*; public …

Member Avatar for Latvija13
0
133
Member Avatar for kukuruku

HI ,I am new in Java and i have trablle creating array of objects .This are my files,and I need to create array of objects patients thank you in advance for your help import java.util.*; public class MainPatient { public static void main(String[] args) { int choice=0; Scanner input=new Scanner(System.in); …

Member Avatar for ztini
0
246
Member Avatar for fengapapitt

Hey guys, I need a little help on PigLatin translator. This is "driver" class I'm given that I cannot change [CODE]import java.util.*; public class PigDriver{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); String t = " "; Piglatin p = new Piglatin(); while(t.length() > 0){ t = …

Member Avatar for peter_budo
0
112
Member Avatar for scratchy999

I'm trying to write a program where I want the user to enter a positive whole numbers into the input box. I would also like to throw up a warning if they enter a decimal, letter, or negative number. I know how to do this with the negative condition, but …

Member Avatar for jon.kiparsky
0
148

The End.