32,204 Topics
| |
Im an AP computer science studen (we started two weeks ago so I dont know much). For homework we had this problem: " Write a program that will let you enter your gender (M or F) and your height in inches and will then tell you wether you are tall,medium … | |
I'm programming a program that add feet and inch together(assume feet and inch are integer). I run into a compiler error. I know the problem is I'm missing the returning statement. But I don't know what to return. [CODE]public class Distance { private int feet; private int inch; public Distance() … | |
Sometimes one line of tool tip is not enough. You may want to try and play around with JToolTip, but if you in hurry this "little hack" can be handy. With little of HTML plus CSS code you can work out various formats (font, colour, alignment, size etc.). | |
I've been trying to modify the following code so that it only displays one scrollbar for 3 radio buttons but so far I just can get it to work right. After the modification the gui should have 3 radio buttons at the top, one scrollbar for all 3 buttons, and … | |
Hello. I would like to ask some suggestions to the community. In Arrays, we can implement a 2D array like: [CODE]String[][] testString = new String[][] { {"1", "2", "6"}, {"4", "5", "3"} };[/CODE] How can I implement this in Vector? Or is that even possible? I was doing it in … | |
So I have this assignment where I am acting as a set. A set that holds numbers. In other words an array I am guessing. So he gave us a generic interface. Then we have to use another class and finish those methods. I'm having trouble because I've never used … | |
when i use border layout and centre alignment, my label content is appearing on left side but i need it on right side, suggest any change here is my code [CODE]import java.awt.*; import javax.swing.*; import java.awt.BorderLayout; class Welcum extends JFrame { Container c; JButton bFd,bAcct; JLabel lWelcome; public Welcome() { … | |
Hey, I've had this question for a while now and forgot to post a thread asking it. I'm really interested in databases and i've been wanting to create a program that recalls information from a database. I've done one that reads a text file but that just seemed...boring to me. … | |
Hi, I am trying to generate javadoc from the file "C:\Program Files\Java\jdk1.6.0_26\src.zip" by using the command "javadoc". But I am not able to do it. How to use that command? | |
How to change the color of selected row of an HTML table without using CSS or Javascript? | |
please some one would explain me why we use Bufferedreader() instead of using InputStreamReader() only. | |
Hello! I write a simple java program. The user will give a URL adres which have some flags. I will parse the URL by this flags. For example the user will give [url]www.exampledomain.com/abc/[/url][[FLAG1]]/abc_[[FLAG2]]gfc I need to parse load to string parsing the URL: String[1]=www.exampledomain.com/abc/ String[2]=/abc_ String[3]=gfc I need to ask … | |
i have a a file Fd.java in which i am trying to call constructor of another class TRrelatn and both the classes are kept in same folder but it is giving error as well as exception that is :\Fd.java:368: cannot find symbol symbol : class TRrelatn location: class FrmAdd new … | |
If have a java program with 4 JTextField. In my JButton add, the event code goes like this: [CODE]add.addActionListener( new ActionListener() { //Handle JButton event if it is clicked public void actionPerformed(ActionEvent event) { try { String add = "insert into person (firstName,middleName,familyName,age) values ('"+inputs[0].getText()+"','"+inputs[1].getText()+"','"+inputs[2].getText()+"',"+inputs[3].getText()+")"; st.execute(add); //Execute the add sql … | |
i am trying to create a project file from existing main files , i create my project file(FixedDeposit) where other files are kept i want to add, and i use the option add existing file and add all the files i want to add. And i make the main of … | |
Hey guys I'm new to java and was wondering if I could have a little assistance. I need to have a user input their number of classes, hours for each class and the grade they received after the information is given i need to calculate their GPA. I have gotten … | |
I have been stuck on this program for MANY DAYS and I really need help. I am a total NOOB! I don't know what more to do. I am far too confused. THIS IS WHAT MY PROGRAM SHOULD OUTPUT: Play the game of Precaution. Try and create as many unique … | |
HI I am new to regex, could anyone help me in finding the java code using regex: My input string is : MyData 68309486 Bob I want to fetch only the digits in sequence like 68309486. PLz help me!!! | |
Hey guys! I am kind of new to Java and am having issues understanding why this code will not run. Any advise would be greatly appreciated! Thanks in advance! [CODE] // Phone.java // Program creates a GUI that resembles a phone with functionality. import java.awt.*; import java.awt.GridLayout; import java.awt.event.*; import … | |
I don't know am i asking right question or not but my question is: I want to create a simple search site so I've team with different jobs. I have its database part to handle. I should create its database and i have not idea what should i do. I'm … | |
So when I compile it says i'm missing an if statement at line 38/39 but im using nested else if's and when I take it out it causes more errors. [CODE]import java.util.*; public class lhlBanking { static final double servicecharge_savings = 10.00; static final double servicecharge_checking = 25.00; static final … | |
Hey guys! I'm new to java, I have to write a program using a linked list, that will prompt a user to enter 10 names, and display them reversed. But is has to be a GUI. Any idea where i can start, or give me some clues, i would really … | |
Hello friends..! I tried to implement HeapSort algorithm in Java. but I've got some problems. First I should say that I have tried to implement the algorithm mentioned in the book "Introduction to Algorithm". the first question is how we can maintain the heap size? The book doesn't help with … | |
Hi hi What would I add to this code in order for it to pick a random word from the txt file? [CODE]try{ RandomAccessFile raf = new RandomAccessFile("Words.txt", "rw"); guessme = ""; while ((guessme = raf.readLine()) !=null){ guessme.toUpperCase(); } }[/CODE] Help is much appreciated! | |
my assignment was to create a calculator using either if statements ir switch methosd i opted for the switch method. everythign compiles but when I type in two integers this is what comes up:Enter two integers to be calculated (separate using space): 2 3 Exception in thread "main" java.lang.NumberFormatException: For … | |
So i had to write a program that uses these functions to add, subtract, multiply and see if the numbers equal each other. and also You must create a way to keep track of the relationships between friends, the spouses, the siblings, the children of the men and women. attached … | |
Hello, I have this code that's giving me some problems: [CODE]import java.util.Scanner; class Bæreevne{ public static void main(String[] args) { int avstand, vektTre, vektBetong; Scanner tastatur = new Scanner(System.in); System.out.print("Oppgi antall meter mellom søylene"); avstand = tastatur.nextInt(); vektTre = 3000 - 20*avstand*avstand; vektBetong = 7000 - 80*avstand*avstand; if (vektTre > … | |
| This is my first GUI program in Java. If finds the day of the week for any given date which is after 1 January 1900. |
I will be interviewed Monday or somewhere along the school week, to take an IB Computer Science course. I told the teacher that the programming class I had was a bit too essay and told her I had experience in C++, C# , VB, and python (basic). But I will … | |
Hi this is my first post, but I've lurked for a while usually finding answers to my questions in other threads, I couldn't find this one so I broke my posting cherry to ask. I know I'm missing something, probably really simple, but possibly I'm doing this completely wrong. I'm … |
The End.