35,618 Topics

Member Avatar for
Member Avatar for DallasFan3

I am trying to make a program that outputs a triangle and the program then should asks the user to enter the size of a triangle to print on the screen. After getting this number, the program should then print a triangle to the screen by printing a series of …

Member Avatar for wilsonz91
0
1K
Member Avatar for akinfemi

public class Strength3 extends ConsoleProgram { private static String[] blank; private static String it; public void run(){ blank = new String[5]; for (int i=0; i<5;i++){ blank[i] = "-"; it+=blank[i]; } println(it); } } why does it print 'null' first. all i want is just 5 hyphens...thanks

Member Avatar for kramerd
0
82
Member Avatar for pRincezZ_fe
Member Avatar for Taywin
0
87
Member Avatar for chmo

hi... I have some questions... Firstly, I have an ArreyList that is stored two String "Name", "Description" This is a database of students [CODE]private void addStudents () { addStudent("ABC","lalala"); addStudent("DEF","hohoho"); }[/CODE] I also have the methods that adds, modify and delete students from the term list. [CODE]protected boolean addStudent (String …

Member Avatar for masijade
-1
398
Member Avatar for chmo

Hi everyone.... I want to develop a music lexicon (tyoe band name --> give description) and I want to add terms (bandName and description) I use ArrayList but I want to change. I have also the code that read a [B]text [/B]file (bands.txt) but I dont know haw it works... …

Member Avatar for masijade
0
542
Member Avatar for chmo

Firstly... I am a new in Java... I have a music dictionary that use an arreylist to store the terms and definition The user use the terminal to interact with this dictionary. [CODE]private void addTerms () { addTerm("Anathema","Atmosheric metal band from Liverpool, UK." } [/CODE] Because, I would like to …

Member Avatar for masijade
0
376
Member Avatar for ajay_tabbu

hello friends i m larning core java.i want some write code of some program by in which i can use the concept of opertors,inhertance so plz me assignment so that i can do practic.

Member Avatar for masijade
0
202
Member Avatar for etrac1912

I'm trying to see if someone can help me with two issues with my program. It compiles fine without errors, but some of my numbers in my amortization table only gives me one number after the decimal place and others give me two numbers. I was wondering if something in …

Member Avatar for Eric Cute
0
95
Member Avatar for frankel81

i need to get the output of 1 2 4 7 11 16 22 i know im on the right track however i cant figure out a way to get the outputs in the right form like 1+2+3 etc like its doing in the output i should get. i know …

Member Avatar for Eric Cute
0
149
Member Avatar for vbx_wx

How can i right shift a binary number and display all of the positions in java ?

Member Avatar for Taywin
0
108
Member Avatar for Chalandria

Write a Java program to continue creating your own userdefined methods and introduce some do while loops. Write two valuereturning methods called farToCel() and celToFar(). These two methods will convert temperatures from Fahrenheit to Celsius and Celsius to Fahrenheit respectively. They will each take a single int parameter and return …

Member Avatar for Eric Cute
0
269
Member Avatar for LianaN

Hi! Could someone please help me to solve one more problem. To read the data (ArrayList) from file, I'm using the following code, which assumes that columns are separated with ",". It works perfectly: [CODE] public static List<UserDataRow> readData() { List<UserDataRow> listofusers = new ArrayList<UserDataRow>(); FileInputStream fstream = null; try …

Member Avatar for LianaN
1
6K
Member Avatar for Tumble_weed

I know this probably doesn't make any sense, but I'm going to try. I have a GUI I created for a checkbook balancing program. And I have an account class with a few extended classes (savingsAccount, checkingAccount, etc). I want to use the GUI I created with the account classes …

Member Avatar for Tumble_weed
0
125
Member Avatar for hassin

program test whether the given integer is perfect or not i dont know why there is some error and how to solve it? [code]class perfect { public static void main(String args[]) { int a=o; int n; for(int i=1;i<=n;i++) { if(a==n) System.out.print("Perfect number"); else System.out.print("Not a Perfect number"); } } }[/code]

Member Avatar for Buffalo101
0
124
Member Avatar for o0oKodako0o

I have a problem about loading/saving ArrayList from/to file. I've searched some thread about this but it's not ok, because the demo used ArrayList<String> but i used ArrayList<Student> with Class Student [ICODE]public class Student { private String id; private String name; private int year; private String genre; private String course; …

Member Avatar for Buffalo101
0
169
Member Avatar for jems5

My attempt to write a recursive method to produce the results of the number of combination where x=13 and y=52 and Combination (y, x) =..... When I use small numbers (e.g.: 2,4) I tend to get a result only when I blank out the 3rd if statement. The formula used …

Member Avatar for JamesCherrill
0
145
Member Avatar for yap_1991

Hi all, I've created a GUI layout for what I am supposed to do. I have 2 combo boxes in the GUI and both serves the same function. The both of them needs to be able to drop-down the list of files from one of my folders. Hence, I just …

Member Avatar for masijade
0
1K
Member Avatar for Krimi

i was wondering if its possible to change the look of the buttons? [url]http://peecee.dk/index.php?id=80239&noresize=yes[/url] the left one is how it looks in Netbeans and the right one is how it looks when i run it. i dont like the one to the right :/ is there any way to change …

Member Avatar for masijade
0
172
Member Avatar for kvkc

Hi i have a requirement to read a text file where field positions are specified and make use of that data to insert into tables. Please refer to the data in the text file below 1234 HEDEPT 12-3-2009 12-03-2009 yesno yes A [email]hello@hello.com[/email] 12 y12 1234 HEDEPT 12-3-2009 12-03-2009 yesno …

Member Avatar for javaAddict
0
206
Member Avatar for 080346

hello everybody; i want to know that how i will open another gui when i click on a button?? thnx

Member Avatar for javaAddict
0
4K
Member Avatar for Buffalo101

Hello, I want to use a JTable for displaying data loaded from a .txt file. The problem is that I don't see any methods for inserting a row. The code NetBeans generates is this: [code=java] jScrollPane1 = new javax.swing.JScrollPane(); tabel = new javax.swing.JTable(); label1 = new javax.swing.JLabel(); jButton1 = new …

Member Avatar for Buffalo101
0
2K
Member Avatar for sonakrish

Hi there.. In sleep(5000) what type of data is 5000??? Is that an integer or byte or something. Thanks in advance

Member Avatar for masijade
0
122
Member Avatar for TheWhite

[code] public class TEST extends JFrame{ ... blah, blah..... private void launch(){ setBounds(200, 200, 100, 100); setDefaultCloseOperation(EXIT_ON_CLOSE); JPanel greenPanel = new JPanel(); greenPanel.setSize(70, 70); //<---- xNot resize the greenPanel greenPanel.setBackground(Color.green); JPanel yellowPanel = new JPanel(); yellowPanel.setSize(50, 50); //<-- xNot resize yellowPanel in greenPanel yellowPanel.setBackground(Color.yellow); greenPanel.add(yellowPanel); JPanel bluePanel = new JPanel(); …

Member Avatar for Azeerazly
0
199
Member Avatar for louiscos77

Hi guys; Just like I said in the <title>, How can I install JBullet in Netbeans? Do I need to write the Monotone commands? 1:0 case:1 then how do I get the mtn commands, is just because it shows this output<< "mtn" is not recognized as an internal or external …

Member Avatar for SgtMe
0
140
Member Avatar for Pandamonium

Hi I am trying to write a program that asks the user for a 2 digit number and then takes that number and prints out its english name. ex: 45 Forty - Five The problem I am having at the moment is that I cant figure out how to seperate …

Member Avatar for griswolf
0
112
Member Avatar for azzman

This is what I have so far. This is a two player game. I need to make it a one player game (player vs. computer). I am also trying to make the computer smart.. for example, if there is an open corner, then it should take that spot. Basically, the …

Member Avatar for griswolf
0
444
Member Avatar for jdiddy

i have used the XMLEncoder to put my list of clients details into but am wondering how i go about retrieving information from the xml files say for instance if i wanted to show all clients who were entered on a specific date? so far i have. public void dxml(){ …

Member Avatar for ~s.o.s~
0
111
Member Avatar for kamweshi

I am trying to make a servlet thread-safe by synchronizing a block of code.The counter needs to count how many times a page has been visited.But it starts at 2 and when i refresh the page, it increments by 2(so it goes 2,4,6).I tried to remove the object variable while …

Member Avatar for Taywin
0
105
Member Avatar for Slobodino

There's this rectangular polygon (all angles are 90* or 270*) which happpens to be convex as well and this rectangular polyline which intersects the polygon on two occasions. The polyline thus splits the polygon into two new rectangular polygons. Is there an easy way to obtains these two polygons in …

Member Avatar for Taywin
0
103
Member Avatar for bluejamesbond

Hello, I am trying to get an image and place a rectangle on top of it as an overlay. So, the image has a different hue as well. Something like this: [URL="http://img215.imageshack.us/img215/8482/picpmf.png"]http://img215.imageshack.us/img215/8482/picpmf.png[/URL] For the overlay: I am currently using this override method on JLabel. It doesnt look that good [CODE]public …

0
56

The End.