36,051 Topics

Member Avatar for
Member Avatar for Pankti Shah

I am making a project where i have a rotating and moving 3d cube and on click of any face of cube, that face should be enlarged. All the six faces of cube should have different images. I searched a lot but doesn't get any working. Any help regarding this …

0
113
Member Avatar for sonu611

Hi all, I was looking for a way to execute windows batch file from java code, and I was able to do this with the following code. [CODE] Runtime rt = Runtime.getRuntime(); Process proc = rt.exec("cmd /C " + "path" +exec.bat"); [/CODE] The batch file refers to some other files …

Member Avatar for shahbaz07dbit
1
1K
Member Avatar for rahul.ch

import java.util.*; class SampleA { } class SampleB extends SampleA{ } class SampleC extends SampleA{ } class VectorDemo { public static void main(String r[]) { Vector<SampleA> v = new Vector<SampleA>(); v.add(new SampleB()); v.add(new SampleC()); SampleC rect = v.get(2); } } The output says "Incompatible types. Found SampleA, required SampleC. SampleC …

Member Avatar for rahul.ch
0
229
Member Avatar for dantheman4

public static void total() { Scanner s = new Scanner("five six seven eight"); int num= 0; for(int i=0; i < s.length; i++) { if(s.charAt(i).equals("a") || s.charAt(i).equals("b") num++; } System.out.print(num); } public static void main(String[] args) { total(); } > What am I doing wrong ?

Member Avatar for Nutster
0
146
Member Avatar for london-G

Hello, I have 3 combobox and I want to find them in my table "class" and retrieve the ID. I am currently having trouble with the following code: public void retrieveClass(String time,String stage, String teacher){ Connection con = null; ResultSet rs = null; java.sql.PreparedStatement st = null; Properties conProps = …

Member Avatar for london-G
0
215
Member Avatar for mikias.kidane.9

I am having a problem with arrays.... for this assignment i can not use Arraylist... I only be able to use array of string. here is my problem. I am asking the user to enter words with in 1 minute ... when the time is up ..i need to print …

Member Avatar for NormR1
0
251
Member Avatar for Sana'a Ala'a

Hi there i'm thinking of starting a database project but i want the DB to be located in a PC works as a server and distribute this DB over an internal network, so many users (clients) can access the DB from their own PC. Any good tutorial or example?

Member Avatar for Sana'a Ala'a
0
82
Member Avatar for jemz

Hello, Is there a way to put some security in the jar files? the java codes are inside the jar file how do i prevent user to see my java codes...

Member Avatar for jemz
0
103
Member Avatar for dantheman4

import java.util.Scanner; public class LoopPatterns { /** * @param args */ public static void main(String[] args) { public static double Largest { Scanner s = new Scanner(System.in); int num, largest = 0; for ( int i = 1; i <= 10 ;i ++) { System.out.print("Enter a number : "); num …

Member Avatar for Starstreak
0
364
Member Avatar for Phadefrequency

define a class containing overloaded method which calculate are of square circle and rectangle depending on the type and numbers of arguments passed. If the number of argument passed to the are is one ,then the area of the cicle and suare should be displayed,however if it is 2 then …

Member Avatar for JamesCherrill
0
5K
Member Avatar for dantheman4

import java.util.Scanner; public class LoopPatterns { /** * @param args */ public static double Largest (){ Scanner s = new Scanner(System.in); int num, largest = 0; for ( int i = 1; i <= 10 ;i ++) { System.out.print("Enter a number : "); num = s.nextInt(); if ( num > …

Member Avatar for NormR1
0
228
Member Avatar for jalpesh_007

I have made one program that work on hash map. I want to do one thing. All the tuples(row) with defined quasi identifier location having value >=k will be moved from map m1 to asMap and it also removed from m1. So at last i am printinf the output of …

Member Avatar for NormR1
0
248
Member Avatar for yup790

I am 2/3 thirds of sams teach yourself java in 21 days and I would like to know what to do to get proficient with programming. I heard I should look at source code, if so where can I find some. What kind of projects should I do. Should I …

Member Avatar for JamesCherrill
0
203
Member Avatar for dantheman4

> I am supposed to create a method called compareParity which compareParity that takes a Scanner containing words as its parameter. The method should return true if the Scanner contains more strings of even length than strings of odd length, and false otherwise. For example, compareParity(new Scanner("The quick brown fox …

Member Avatar for JamesCherrill
0
109
Member Avatar for amir734jj

String s1 = "+1-2+3-4+5+6-7"; String s2 = "1-2+3-4+5+6-7"; I want to find the value of sum of each of those string in integer ? there can be only addition or subtraction

Member Avatar for zw_jvdijk83
0
94
Member Avatar for Hharla

Hi, I'm having problems with this assignment. First off a Markov matrix is simply a 3x3 matrix that when the rows are added always equal 1. I am suppose to write a program to prompt the user to enter a matrix and then it is determined wether or not that …

Member Avatar for Hharla
0
196
Member Avatar for btbessaay

I made a battleship game and its gone well except for checking if the ship is sunk... Any help? Here's what I have so far, thanks in advance. public class BattleShip { private static final int dimensions = 10; private String[][] board = new String[dimensions][dimensions]; private String[][] piecesBoard = new …

Member Avatar for VernonDozier
0
262
Member Avatar for FUTURECompEng

I have the user input a sentence (example " Hello this is some jello "). I already have that complete by having a method to do this. What the method does is take a user input (.nextLine) then stores the words of the sentence into String[] words and I use …

Member Avatar for FUTURECompEng
0
172
Member Avatar for spring2014

The purpose of the program is to take 4 user inputed integers (days, hours, minutes, and seconds) and output them as a floating point doubles to show the maximum amount of time possible for each. For example I input 2 days, 10 hours, 45 minutes, 20 seconds and it outputs …

Member Avatar for NormR1
0
605
Member Avatar for minimee120

Hi, I'm completely new to Java and having some trouble basically understanding everything. I have some code and am wondering how to edit it in order to make some questions that I'm being asked to work. Here's the code: import java.util.*; // for class Scanner public class Copy { public …

Member Avatar for NormR1
0
221
Member Avatar for Hemanth.Satkuri

Hi , I have a java string like: From: someuser.ha@domain.comDate: 8/7/2012 5:20:39 PMTo: abcd@domain.comCc: abcd.efg@domain.comSubject: This is the suject line Hi,I would like to recover all my money from the bank. Would you be able to send me them?Regards,Farooq. Actually above is the email content which is read as a …

Member Avatar for NormR1
0
142
Member Avatar for sidhartha93

after writing the codes and saving it..while i compile it in comand prompt it shows an error as 'javac file not found '

Member Avatar for NormR1
0
49
Member Avatar for aabbccbryanmark

import java.io.*; public class QuizBee { public static void main(String[] args)throws IOException { BufferedReader a = new BufferedReader(new InputStreamReader(System.in)); int cor=0; System.out.println("\t \t \t \t \t \t \tWelcome to 10th Annual Quiz Bee of the Year"); System.out.println(); System.out.println("General Direction: In this question you are obligue to answer them honestly."); System.out.println("\t …

Member Avatar for aabbccbryanmark
0
206
Member Avatar for gelmi

**Enter row number: 4 Sum of numbers in row 5 is 31. Sum of all numbers above 4 is 15. this should be the output look like.. can someone help me? thanks.

Member Avatar for Nutster
0
427
Member Avatar for green_ning

Hello guys. I am a starter in Java Programming. And I wanted to understand and manipulate it effectively from now on. I also want to start developing applications in iPad or iPhone but I am a Windows user, and I guess I need a Mac in able to do that. …

Member Avatar for green_ning
0
272
Member Avatar for aabbccbryanmark

System.out.println("\t \t \tYou got " + (cor/10*50+50) + "%"); help me with this code.. i didn't get what's supposed to be the percentage.. what's wrong with it?.. i got 3 for cor and i should have 65% but i just get 50%..

Member Avatar for JamesCherrill
0
112
Member Avatar for rvijaya

Hi, so I have to write a program for my Java assignment and I am just starting out so I might be doing this wrong but I can't figure out why it won't invoke the method I have created. import java.util.Scanner; public class EvalMarks1 { public static void main(String[] args) …

Member Avatar for rvijaya
0
154
Member Avatar for tformed

Hi guys, I've got the program running, but not as how the instructor requested. The professor wants us to ask the user for a text file and classify the data accordingly. Example: E = Enter L = Leave So if I have a text file with the following info E …

Member Avatar for jalpesh_007
1
335
Member Avatar for javaprog200

Hello, Are any of the older exams for the Sun Certified Java Programmer certification available online? I was able to find mock exams and other test prep material. Just wondering if earlier exams are available. Thank you!

Member Avatar for rotten69
0
177
Member Avatar for forjustincase

Can someone help me understand the code below? I'm trying to figure out how it's getting the text file to read from. public static void main(String[] args) throws Exception { if( args.length < 2 ) { throw new Exception( "Usage: inputFileName outputFileName"); } Box d = new Box(8); PrintWriter pw …

Member Avatar for DJSAN10
0
130
Member Avatar for Raghu88

package com.zyom.struts.ats.action; import java.io.File; import java.text.NumberFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.HashMap; import java.util.Iterator; import java.util.List; import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import jxl.Workbook; import jxl.write.Colour; import jxl.write.Label; import jxl.write.WritableCellFormat; import jxl.write.WritableFont; import jxl.write.WritableSheet; import jxl.write.WritableWorkbook; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionMapping; import org.apache.struts.actions.DownloadAction; import org.apache.struts.actions.DownloadAction.ResourceStreamInfo; …

Member Avatar for Raghu88
0
268
Member Avatar for banana.apple001

Okay, I'm very new to Java as a whole, and I'm just trying to get to grips with it. I'm experimenting with classes, and I'm struggling to get this one thing to work. Basically, I've made a short program which one can make matrices, and all it has at the …

Member Avatar for banana.apple001
0
274
Member Avatar for brandon66

![WidgetRunning2](/attachments/large/3/WidgetRunning2.jpg "WidgetRunning2") hey everyone, need some help here im trying to create this(in the picture shown) but the problem im having is when i select the item from the combobox i want to show the price in the text field as shown but im not sure how i would go …

Member Avatar for NormR1
0
201
Member Avatar for krovi

while importing the .ts file into jdk showing the error as "keytool error: java.lang.Exception: Input not an X.509 certificate".So how to resolve this

Member Avatar for kamyarn
0
44
Member Avatar for jallalovski

import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.PrintWriter; import java.util.Scanner; public class Concat { public boolean accept(File file) { //if the file extension is .txt or .java return true, else false if (file.getName().endsWith(".txt")||file.getName().endsWith(".java")) { return true; } return false; } public void copy(PrintWriter pw, String inputFile) { File …

Member Avatar for NormR1
0
133
Member Avatar for ritaphuti
Member Avatar for sassy14udd

I have been a member here for awhile altho I have not been online in some time. Now, I'm trying to get back into the swing of things again. I am self taught as far as the code I know with intensions of going back to school as soon as …

0
109
Member Avatar for DahliaBasik

/** * @(#)GeometricObject.java * * GeometricObject application * * @author * @version 1.00 2012/9/10 */ public abstract class GeometricObject { private String color = "white"; public GeometricObject(){ } public GeometricObject(String color){ } public String getColor(){ return color; } public void setColor(String color){ this.color=color; } public String toString(){ return " the …

Member Avatar for DahliaBasik
0
2K
Member Avatar for strizh

I need to override String toString method so it woud print my deposits I dont't know how to override it, since in makeDeposit method I pass two variables I'm posting just a saple of my code, I'm not sure if you need the whole code public class Bank { private …

Member Avatar for stultuske
0
164
Member Avatar for anglwthnati2de

Hi guys. I am having issues with the output of this program. Can somebody tell me what I have to do to make this work correctly? Here is the code I have so far: import java.util.Scanner; //text scanner to parse primitive types and strings using regular expressions. public class Operations …

Member Avatar for anglwthnati2de
-2
277
Member Avatar for aabbccbryanmark

public class asterisk { public static void main(String[] args) { int row, col, spc=3, spc1=2, spc2=1, spc3=0; for(row=1;row<=1;row++) { for(col=1;col<=1;col++) { for(spc=spc;spc>0;spc--) { System.out.print(" "); } System.out.print("*"); System.out.println(); { for(spc1=spc1;spc1>0;spc1--) { System.out.print(" "); } System.out.print("**"); System.out.println(); { for(spc2=spc2;spc2>0;spc2--) { System.out.print(" "); } System.out.print("***"); System.out.println(); { for(spc3=spc3;spc3>00;spc3--) { System.out.print(" "); } …

Member Avatar for stultuske
0
592
Member Avatar for gurusubramaniam

Hi.. I want redirect a frame into next frame. In swing method how to redirect a frame into next frame ?

Member Avatar for stultuske
0
137
Member Avatar for poojavb

Hello All, I have a Java program which is using a JOptionPane in it. eg. Are you sure u want to close the application? Yes No When I click with the mouse on the No button it works correctly but if I select the No button using the TAB key …

Member Avatar for poojavb
0
412
Member Avatar for Matth963

I want to do this: When I press on a checkbox 'Monday', the program displays the List 'lstMonday' When I press on a checkbox 'Tuesday', the program displays the List'lstTuesday' How can I achieve this? I've tried to do it ut can't:( Thanks in advance

Member Avatar for stultuske
0
113
Member Avatar for borchu

Hello everyone, I have question about how AudioTrack instance should be used for streaming applications. Below my code example and some brief explation about code ... /* some work before */ InputStream in = client.getInputStream(); AudioTrack output_stream = new AudioTrack(AudioManager.STREAM_MUSIC, 8000, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_8BIT, 8192, AudioTrack.MODE_STREAM); byte[] buffer = new byte[8192]; …

Member Avatar for borchu
0
543
Member Avatar for jury

hy!!!!i am trying to write a java code that returns the majority element in an array and -1 if not!!this is what i came with public class Majority{ public static int arrMajority1(int A[]){ int n = A.length; int c = 1; for(int i=0;i>A.length;i++){ for(int j=i+1;j<A.length;j++) if (A[i]==A[j]) c=c+1; if (c>(A.length/2)){ …

Member Avatar for Nutster
0
142
Member Avatar for adishardis

I'm trying to use limesurvey but cannot get the slider as i would like it. Here is a link to the surveyquestion: http://adam.synology.me/limesurvey/index.php/survey/index/sid/164171/newtest/Y/lang/sv I want the images to change according to the value of the sliders. With a regular html form i had this to take care of it: <script …

Member Avatar for adishardis
0
202
Member Avatar for mobility42

Hello All, this is my first post, so bear with me... My problem is with the following code. I have a simple menu setup to do some number conversions, and everything compiles properly. When i run the code, i end up with the Java VM (in bluej) just running endlessly, …

Member Avatar for NormR1
0
1K
Member Avatar for classicshot

how can we create accounting vouchers use in departmental store for selling products through jswing in java programming..??

Member Avatar for NormR1
0
69
Member Avatar for london-G

Hello, I am currently working on a project and I am stuck at the moment. Basically I have a few JToggles buttons, a jbutton and a text box. When the user select a jToggle button, write some text in the text box and clicks on the Jbutton, the text on …

Member Avatar for london-G
0
127

The End.