36,051 Topics

Member Avatar for
Member Avatar for ~s.o.s~

[URL="http://www.youtube.com/watch?v=b-Cr0EWwaTk&feature=player_embedded#!"]An Oracle produced song to promote Java; fun stuff[/URL]. ;-) Lyrics at: [url]http://www.adam-bien.com/roller/abien/entry/code_hard_with_java[/url]

Member Avatar for Netcode
0
133
Member Avatar for b.netana

[CODE]import java.util.Arrays; import java.util.Comparator; public class CameraInventory2 { // The main entry public static void main(String[] args) { // create the array Camera[] camera = new Camera[3]; Cam cam = new Cam(); camera[0] = new Camera(1, "Nokia", 20, 30.0, 8); camera[1] = new Camera(2, "Polaroid", 10, 21.0, 14.1); camera[2] = …

Member Avatar for hfx642
0
288
Member Avatar for teo236

hello i'm trying to draw a kind of arrow with an specific thickness. i've already this: [CODE] public void paintComponent(Graphics g){ super.paintIcon(comp, g, width, height); for(int i=0;i<thickness;i++){ Polygon arrow=new Polygon(); arrow.addPoint(7*scale, 0*scale+i); arrow.addPoint(14*scale-i, 9*scale-i); arrow.addPoint(10*scale-i, 9*scale-i); arrow.addPoint(10*scale-i, 29*scale-i); arrow.addPoint(4*scale+i, 29*scale-i); arrow.addPoint(4*scale+i, 9*scale-i); arrow.addPoint(0*scale+i, 9*scale-i); g.drawPolygon(arrow); } g.setColor(Color.BLUE); Polygon arrow=new Polygon(); …

Member Avatar for hfx642
0
128
Member Avatar for esy928

Hello! Im a java noob and I need to create a program that determines whether the input is an integer or not , can anyone help me out? thanks in advance! btw I have to use [B]Scanner [/B] from [B]java.util.[/B] , I have no idea on how to check if …

Member Avatar for abors
0
641
Member Avatar for zach&kody

After compiling this code, I am getting a "cannot find symbol constructor Timer(int,Morning)" on line 17. [CODE]import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Morning extends JFrame { private EasySound rooster; private int time; /** * Constructor */ public Morning (int time) { time = 0; Timer clock = new …

Member Avatar for stevenwilson
0
407
Member Avatar for gchaim

Hello I need to create a graphic simulator for MIPS CPU, something that will show the structure of the CPU, and when getting a text file with MIPS code- it will show how does each command executed through all the CPU parts. However, i have never worked with grpahics, i …

0
47
Member Avatar for bhagawatshinde

Hi, i am trouble to connect with sqlserver 2005 in windows authentication mode which do not contains username and password it will give me an error like connection failed for user ''(blank) here is my connection string [CODE]string URL="jdbc:sqlserver:\\localhost:1433;dbname"[/CODE] can anybody help me please

Member Avatar for ~s.o.s~
0
88
Member Avatar for dgar

Hi , My name is Dennis a DBIT student.I am kindly asking for assistance in any of the following questions .It's part of my research so i kindly request if you would explain to give me a better understanding and also equip me with the knowledge of handling questions of …

Member Avatar for peter_budo
0
121
Member Avatar for gotm

hey guys. OK so, I've been wondering this for a while now. my code is always so unnecessarily cluttered because I don't know how to do this, lol. say I have a set of private class variables: [code=java] private ArrayList row0 = new ArrayList<String>(); private ArrayList row1 = new ArrayList<String>(); …

Member Avatar for JamesCherrill
0
167
Member Avatar for cwarn23

Hi, I'm developing a new Java applet and it requires a 3d engine to import a 3d model with a texture wrapped around the model. Then the user will be able to browser around the model in like a first person shooter style but just browse/look around, nothing else. Does …

Member Avatar for cwarn23
0
160
Member Avatar for WolfShield

C++ was once the King of programming. It would crush any competitor! But, now it seems that C++ is getting less popular. New programmers are rushing to easier to learn, higher level, programming languages (e.g. Java). And with Microsoft coming out with C# which is gaining popularity (even though it …

Member Avatar for Netcode
0
1K
Member Avatar for eddieteddie

Hi all Can someone tell me the difference between public static void main and private static void main? What is public and what is private and static? Thanks guys+girls

Member Avatar for bhagawatshinde
0
88
Member Avatar for ravsau

Hi everyone. I am new to java programming and taking a class in college. I got to a problem which I can do but i don't know the correct way to do it. It says to use mutator and accesor . can you please explain what should i change? I …

Member Avatar for dononelson
0
880
Member Avatar for cmsc

I'm trying to use bufferedImage to display the bac[ICODE][/ICODE]kground of my application but i'm not successful. I don't get what's wrong with it here's the part of the code: [ICODE] Graphics g; BufferedImage offscreen; offscreen= ImageIO.read(new File("mainScreen.png")); g.drawImage(offscreen, 0, 0, null); [/ICODE] and i use the paintcomponent() here : [ICODE] …

0
69
Member Avatar for rezial

hey i got this 3d cube that rotates and does other cool nonsense HOWEVER i cant figure out how to color it. Need to do it with out using java 3d and i DO know about the painters algorithm, i just dont know exactly how to go about implementing it …

Member Avatar for hfx642
0
358
Member Avatar for sjava

public class Employee { private String Name; private String SIN; private Integer Salary; public Employee(String string, String string2, int i) { // TODO Auto-generated constructor stub } public Employee() { } public Employee(String N, String sin, Integer Sal) { Name = N; SIN = sin; Salary = Sal; } public …

Member Avatar for sjava
0
115
Member Avatar for blackrobe

Hey all, I've been struggling for the past few days with a "recursive" function that was driving me crazy till this moment. So, the function takes a list of sublists, each sublist containing a number of strings. Then, the function returns a list of lists of all possible combinations that …

Member Avatar for Mavericks
0
9K
Member Avatar for cozmo87

The following code works: [CODE] public class Main { public static void main (String args[]){ final JWindow f = new JWindow(); JLabel l = new JLabel(new ImageIcon(Main.class.getResource("images/logo.png"))); f.getContentPane().add(l, BorderLayout.CENTER); f.pack(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension labelSize = l.getPreferredSize(); f.setLocation(screenSize.width/2 - (labelSize.width/2), screenSize.height/2 - (labelSize.height/2)); f.setVisible(true); f.setAlwaysOnTop(true); } }[/CODE] When I …

Member Avatar for cozmo87
0
623
Member Avatar for christot

please help me , i really dont have any idea about our project . i need to fix it 1 week before our defense so that i can work well with it and study all about it ..

Member Avatar for christot
-1
222
Member Avatar for Delocaz

I'm looking for how to brute-force the result of something like [ICODE]"Hi".hashCode()[/ICODE]. I have no idea where to start. I looked for the answer for like 5 hours yesterday. It's for reversing Minecraft seeds. (seed-to-text). I tried my own solution. It's too crap to even post. I tried to find …

Member Avatar for Delocaz
0
1K
Member Avatar for i2u2me

In Java Create a file using any word processing program or text editor. Write an application that displays the file's name, containing folder size and time of last modification. Save as FileStatistics This is what I have with Attributes errors, what am I missing here ? Thanks <CODE> import java.nio.file.*; …

Member Avatar for stultuske
0
182
Member Avatar for twinkle2011

[CODE]import java.io.*; class FinalProject{ public static void main(String[]args){ String name=" ", month, date; int total,cash=0,bal=0,y=0; int r=0; boolean ans=true; int test; do{ try{ FileWriter extend = new FileWriter("extension.txt",true); BufferedWriter out = new BufferedWriter(extend); System.out.print("Welcome! to GLORIA'S FUDHAUZ \n"); System.out.print("Enter date: "); date = Enter.readString(); System.out.print("Enter name: "); name = Enter.readString(); …

Member Avatar for stultuske
0
86
Member Avatar for SagarSe7en

Hello Everyone! Very close to completing my project but a small favor needed! Which is blocking me from finishing the last section of the project! This is how it goes!!!!! Have an Interface with inc complete methods [CODE] //OshwalDAO.java void InsertLog(String LogID , String Username , java.Util.Date CurrentDate) throws ClassNotFoundException …

Member Avatar for SagarSe7en
0
898
Member Avatar for Santosh gupta

[CODE] [1]class A{ [2]public static void main(String...agrs){ [3]String str1="ABC"; [4]String str2="ABC"; [5]String str3=new String("ABC"); [6]} [7]} [/CODE] How many objects are created at each line and finally at line 7?

Member Avatar for Santosh gupta
0
105
Member Avatar for laguardian

Hey guys! I'm working on a console calculator. My problem is that how would I perform the inputted operator? So, if the user inputs "+" and a "-" it will perform those. Here's what I have so far: [code] import java.util.Scanner; public class Calculator { public static void main (String …

Member Avatar for harinath_2007
0
141
Member Avatar for Mugetsu Tensho

Hi, its has been a long time since I have used java and I would like some help making this loop as long as you say yes when you say no the loop will stop but not the program [CODE] if (place.equals("swordsmith")) { System.out.println("Hello " + name +"! Would you …

Member Avatar for Mugetsu Tensho
0
288
Member Avatar for cdea06

So I'm trying to add a while loop so that the program continues to ask for the user to enter a new string phrase after the previous one is counted until the user enters the phrase "quit". However, for some reason if you enter anything but "quit" it just produces …

Member Avatar for Taywin
0
225
Member Avatar for NICEGUY123

Input file looks like this BASKETBALL John Smith 23 , 54 FOOTBALL Jose Cruise 445, 23 BASKETBALL KJ 34, 32 BASEBALL Mike Beterman 3, 2 FOOTBALL David Smith 323, 23 Below is my code. What is happening on my output I get Sport: BASKETBALL Name: John Smith Stat: 23 , …

Member Avatar for Taywin
0
378
Member Avatar for marvolo1300

[CODE] int a [0] = int b [1]; [/CODE] I get this error. [QUOTE]Type mismatch: cannot convert from int to int[][/QUOTE]

Member Avatar for marvolo1300
0
136
Member Avatar for warlord902

I want to make node heights of JTree nodes to differ. I mean like the parents have different node height and childs have different node height. I tried to put myJTree.setRowHeight(30) while adding nodes but it doesn't work because it does not work for a single node but for the …

Member Avatar for mKorbel
1
982
Member Avatar for Justinedeleon

My deadlines are running @.@ please help me on how to make a curve fit for this little ballie dude i created. again as a proof of what im doing . can someone help me with this? i need to come up with something like --> ":3" thanks guys. [CODE]import …

Member Avatar for hfx642
0
677
Member Avatar for herstein

Hey guys. I am trying to write a programme (not using scanner class) which prints the smallest number in an external text file called README.txt. Anyway I included some explanation of what I am doing so hopefully it's clear. What this programme prints is 0.0, which is not even a …

Member Avatar for JamesCherrill
0
127
Member Avatar for pradeep_java

How can I store a number with 10^6 digits in Java? Would BigInteger be the most appropriate while considering performance issues like memory and speed

Member Avatar for JamesCherrill
0
1K
Member Avatar for Justinedeleon

Oh. btw admin! sorry about my earlier thread. i promise not to do something like that ever again :) anyway. i was having trouble with my project and its about Multiplication with loops. i started with a few codes and im really frustrated with what im doing now. please let …

Member Avatar for Justinedeleon
0
342
Member Avatar for sc0field1

I need to generate 500 random numbers from 200 to 1200 and use insertion to sort them. This is probaly simple for you guys but im confused. My problem is when i run the program all I get is 500 0's. Anyone help me out? [CODE]public class insertion{ public static …

Member Avatar for JamesCherrill
0
123
Member Avatar for dangari

My query below has been working okay for 1 year now and suddenly it is giving an exception: [CODE] (SELECT distinct(R.imei),R.mobile,S.msg,S.reply,M.model, left(S.receiveTime,10) as receiveDate, right(S.receiveTime,8) as receiveTime,'' as 'Reason' from dbSAMSUNGmain.tREGDATA R,dbSAMSUNGmain.tMODELS M,dbSAMSUNGmain.tSMS_TRANSACTIONS S where S.mobile=R.mobile and replace(replace(S.msg,'/',''),' ','') LIKE concat('%',R.imei,'%') and (S.reply like '%Registration successful%' || S.reply like '%Reg …

Member Avatar for mickjsn
0
297
Member Avatar for vishalonne

Hi Every Body Does any one help me in deploying and running Servlet and JSP in Tomcat 5.5 I tried all the ways I found on net. I downloaded lots of tutorials and tried them also. But always getting same ugly error CONTEXT Path not found \TestInput I am just …

Member Avatar for peter_budo
0
200
Member Avatar for angelineygrubay

need help ... i need to have a java code for the feistel block cipher .. i know you can help me ... ' please .. :p -- thank you in advance /..

Member Avatar for peter_budo
0
166
Member Avatar for xtinawp

Hello, I have just started in a java class and having trouble with first assignment. Our first assignment was to enter into Notepad++ and enter a java program provided to us. I did this and saved the program as Quiz1.java. The next step was to compile the file using the …

Member Avatar for peter_budo
0
1K
Member Avatar for Ruchit bajwa

hello,i am using MS-access db and java code.i want to insert values in a particular row based on selected serial no. and i use statement [code] try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con2=DriverManager.getConnection("jdbc:odbc:ResumeDSN"); Statement stat1=con2.createStatement(); Statement stat2=con2.createStatement(); stu = new Student(); String Fir6=pers.tname.getText(); if(Fir6.equals("")==true){Fir6=" ";} String Sec6=pers.tdob.getText(); if(Sec6.equals("")==true){Sec6=" ";} String Thir6=pers.tfather.getText(); if(Thir6.equals("")==true){Thir6=" …

0
59
Member Avatar for atramposch

Ive written these two methods but they are giving me lots of problems. [CODE]public int indexOf(Object element) 128 { 129 for(int i = 0; i < list.length; i++) 130 { 131 if(list[i] != null && list[i].equals(element)) 132 { 133 return i; 134 } 135 } 136 137 throw new IndexOutOfBoundsException(); …

Member Avatar for Taywin
0
88
Member Avatar for tootiemae

How can i write a java program that will read the radius and height of a cylinder and compute the volume using the formulas Area= raduis*raduis*3.14159 and Volume= area*height, and have the program report the area of the bottom of the cylinder and the voulme of the cylinder.

Member Avatar for k-broxe
0
246
Member Avatar for Sai Sotes
Member Avatar for mhamy

Can you explain to me what's the meaning of the algorithm of SHA-1? ========================================================================== [CODE]package Finals; import java.io.UnsupportedEncodingException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class SHA { private static String convertToHex(byte[] data) { StringBuffer buf = new StringBuffer(); for (int i = 0; i < data.length; i++) { int halfbyte = …

Member Avatar for JeffGrigg
0
176
Member Avatar for Ryden

Hello, I was asked to write a program that starts with a JFileChooser, the user is asked to choose a file. If at anytime during any part of this program, the user hits "cancel" or "yes" when the dialog shows "do you want to continue?" the program will return back …

Member Avatar for Taywin
0
343
Member Avatar for Laxman2809

Ok thank you for that explanations, but now I have an issue with my code. My remove function doesn't see to be working. Now I think it has to do with the fact it is not setting that CDs information back to empty or 0. Also it only stores 1 …

Member Avatar for Laxman2809
0
148
Member Avatar for danthevan

I am a student and we are working on a project in Access database but in windows. When I go back home I tried to run and edit the project but it didn't work. Notice that I don't have Access installed on my mac. My questions: 1- do I have …

Member Avatar for Ezzaral
0
145
Member Avatar for liphoso

i have the code below, i want to use a switch-case to check the grade of the student, my problem is that the compiler tells me that swithc only takes intergers as arguments. i had thought i cud have a statement like case a > b where a and b …

Member Avatar for JamesCherrill
0
167
Member Avatar for atramposch

I'm writing an indexOf method for a class called BasicArrayList. i have two private instance variables an Object[] called list, and an int called size. [CODE]public int indexOf(Object element) 67 { 68 for(int i = 0; i < size; i++) 69 { 70 if(list[i].equals(element)) 71 { 72 return i; 73 …

Member Avatar for atramposch
0
138
Member Avatar for Ryden

I have to deal with a program on arrays doing different things with such as finding out if the row contains a number in the first n rows, put all the numbers listed in the arrays without repeating numbers that are listed twice, finding numbers that are in common and …

Member Avatar for JamesCherrill
1
120

The End.