32,205 Topics

Member Avatar for
Member Avatar for drogba123

Hi, I know matrix 2d can be written like array[5][5] which saying 5x5 matrix but how do i make the row is like sequence of alphabets so its like array[a...z][5] while the column still numbers. Thanks.

Member Avatar for drogba123
0
119
Member Avatar for jeffreymummey

I need to build a gui application for Nim. I started writing the code and need help. Will you help me write the Nim game? import javax.swing.JOptionPane; public class Nim { public static void main( String args[] ) { String firstNumber; String secondNumber; int number1; int number2; int sum; firstNumber …

Member Avatar for pluspluss
0
107
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
129
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
286
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
126
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
635
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
404
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
86
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
118
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
165
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
158
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
86
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
877
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
66
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
354
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
112
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
614
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
219
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
180
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
85
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
101
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
137
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
266
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
223
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
377
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
133
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
967

The End.