3,978 Topics
![]() | |
hey all when i run this code : import java.awt.Canvas; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.event.WindowEvent; import java.awt.event.WindowAdapter; import java.awt.image.BufferedImage; import java.net.URL; import javax.swing.JFrame; import javax.swing.JPanel; import javax.imageio.ImageIO; public class SpaceInvaders { public static final int WIDTH = 800; public static final int HEIGHT = 600; public SpaceInvaders() … | |
Hello. As i couldnt work out my problem with my other version, i re-wrote it in a totally different form, now my program does display all the entries i make,, but the problem now is how do stop the dialog box from keep coming up. For example: i input 2 … | |
Ok i've understood the use of arrays and most of it.... but my problem is no matter wat i do my program still only displays the last entry i make and not all. i've tried a for loop in the print method but no luck. Neone know what im doing … | |
WEll I'm kinda new to Java programming...but we got a major project coming up and I got stuck on one of the examples. This is for a validation code, to validate correct inputs....the errors are highlighted in red...Thanks to anyone that bothered to help :P I'm sure the answer is … | |
Hi all, This program below sorts arrays of integers. It counts the number of times it compares pieces of data to do the sort.With the array size set at 4 it always takes 9 comparisons. Does neone know how i can Modify it to read in a series of four … | |
Hi, I have a fileoutput method which when called, should output the array into a text file. The array is stored in the same public class as the fileoutput method and I am using a constructor for the array, which is in the Cd class. I would like to know … | |
This is a piece of work i need to complete for my Object Orientated programming module at university. The task, (User Input) Order Number, Name, Address line 1 and Address line 2 and select either Computer and/or printer check box. N.B. These FIVE fields must be completed by User otherwise … | |
Hi thanks for comming to this thread... can any one give me the idea how to use javax.swing.Icon interface? | |
Ok wrote this program out, compile it it compiles, when i run it it starts off nicely, but when i enter Album Name it gives me an error. Neone know where im going wrong..... import javax.swing.*; public class CdStorage { public static void main (String[] args) { String menu_choice; int … | |
I at least have the program working correctly thanks to the awesome help from various boards and people I work with. However, now I want to tweak the program a little bit. I am currently using a combobox for the interest rate and term. I would like to use either … | |
Hi all, Ok i've started doing a mini project about a CD collection database. i got the program working ata stage where you can enter a single entry and the record is printed to the screen, the problem im having is i can not seem to modify the program to … | |
Hi Everybody, I was wondering if anybody could help me. I want to find the most frequent lettter, and replace it with another letter. It hen want to find the second most common letter and replace it with another letter. It's not working. Could anybody please help?? [CODE]import javax.swing.*; import … | |
I have this system which I only want to try and borrow books from a library. I have data already in arrays. I need to check that nobody else has a book then add it to the data. I have commented where i think the problem is. i have tried … | |
My applet is not showing up in a web page, and all of the code is correct... I'll post it and the html code: [Code] // import all need packages import java.awt.*; import javax.swing.*; import java.awt.event.*; import java.applet.*; //extend JFrame for the user interface and actionlistener for events public class … | |
I am doing a visual traffic simulation project and i have the named problem in my main class.How do you solve it.the problem occurs in the following segment of the program:The roadDesigner,roadNetwork andsimPanel symbols cannot be resolve.(The problem starts at the bolded part of the program) [code] import java.awt.BorderLayout; import … | |
Hi: I'm writing my own programming language and I wanted to be able to save the code. When I compile i get this error message: "cml.java": cannot resolve symbol: constructor cml (int[],int[],java.lang.String)in class cml at line 439, column 13 Here's the code: [CODE]//Cinnamon Machine Language Compiler import javax.swing.*; import javax.swing.event.*; … | |
I have created a GUI Java menu using a pull down menu in which I want to have the date and time show up. I am currently getting null for my time value and I think it is because I am not refreshing this each time I calculate my time … | |
[b]Declaring Objects[/b] When one works with classes, each instance of the class which is defined is known as an object. C++ is an extremely object oriented language (perhaps not so much so as Java, however). In OOP, or Object Oriented Programming, one can easily perform multiple tasks on objects which … | |
I had all of this program finished except for the plotting like a week ago...Ever since then, I've been trying to figure out how to plot the stupid polynomials..I thought I had it, but the program seems to go crazy whenever it's suppose to repaint..It's like repainting components on top … | |
This class is suppose to create a JPanel with a bufferedimage to draw on..I instanstiate this class from the main driver class, and it shows up fine, but I can't draw anything on the image, or even set the background color of the jpanel. Here is the class, see if … | |
Hi everyone, I am trying to save the contents the of the jtable together with all its fonts and everything else. The program compiles without any errors but When i try to save the contents of the JTable an exception is thrown in the tablesaveas method in the below method … | |
I have been using JAVA for a whole two weeks now. I am enrolled in CSC 148 at my local college. I am supposed to write a program that asks the user for his or her age and replies with the day of the week on which he or she … | |
Hi everyone, I am currently trying to print a swing component a JTable to be exact but the thing is that i want my user to be able to print even, odd or all the pages. The thing is i am using the swing print dialog and not the windows … | |
Hi im new here and im desperate because my java program is due at midnight and im stuck. my computer froze at one point and i lost a lot of info and i thought i put the info back in but now it wont compile.here is the assignment: > Write … | |
Does anyone know how you could process an equation, or even get an equation with more than two operands? Right now, in my calculator, I can only have two operands, and I want to have more. Right here is what I have: [Code] import java.awt.*; import java.awt.event.*; import javax.swing.*; public … | |
As a part of our project i need to learn 'JAVA swing'. can i get a free tutorial on it anywhere ,or any site ,u could suggest.i got a couple of books on java but none has more on swing. Please help me. | |
I have this simple calculator I just started on, and I'm having just a few problems. First of all, I don't know how to append text to a textfield. Maybe I would have to create a string buffere or something. Then, when the user clicks one of the buttons, the … | |
Hi everyone, I just came home from a software conference in nagoya, Japan where they had any kind of software you can think of on this planet. There was one talk i went for and i think its quite interesting to have it discussed fully here. Alot of the companies … | |
Hi everyone, I have two weird questions but bear with me for a while. The first question is about the printing of a styled document using the printable interface. i am using windows 98 and using the windows page format and print dialog. I have managed to print all the … | |
Can i insert a JPEG picture into my application with out import javax.swing.*; ????? or is where a way to do that with out import javax.swing.*; ??? | |
How can i add reversing line code to the following code. Program must read the document which is selected by user from filechooser and write the reverse lines to another file. Additionally, I have to add a histogram which shows the length of each lines in document. [code] import java.awt.*; … | |
Hi, I want to load a simpel image into a JPanel. I use the following way: public class MyClass{ private Icon Bild = new ImageIcon("http://today.java.net/jag/old/green/duke/T4.gif"); JLabel jLabel2 = new JLabel(Bild); private void init (){ jLabel2.setBackground(Color.white); jLabel2.setForeground(Color.white); jLabel2.setBorder(BorderFactory.createEtchedBorder()); jLabel2.setPreferredSize(new Dimension(100, 70)); jLabel2.setIconTextGap(0); jLabel2.setLabelFor(contentPane); jLabel2.setIcon(Bild); } } I think the code is … | |
Hi everyone, I am currently trying to create a tool that jars all my classes into an executable jar. What i mean is that when i click on the particular jar file in windows explorer the program is run. I managed to create the jar file but the problem is … | |
Hi All, Can anyone help me out in figuring how we can open an Internet explorer in say "Borderlayout.center" of the frame. | |
I get this when I try to load my program, yet the compiler says its fine. Please help! Exception in thread "main" java.lang.NoClassDefFoundError: PIStudy$DoPolyINTest at PIStudy.<init>(PIStudy.java:51) at PIStudy.main(PIStudy.java:121) [CODE] import javax.swing.*; import java.util.Random; import java.awt.*; import java.awt.event.*; public class PIStudy { public JFrame window; public JButton name; public JButton comb; … | |
Hi, I'm in URGENT need of anyone who can help me with the following TicTacToe code. When you run it, it lets you click a box. When you click a box, X appears. The, when it's O's player's turn, it will not print an O. [CODE] import javax.swing.*; import java.awt.*; … | |
I am trying to develop an application that can display four clocks in a frame that update at the following intervals: 1 second, 5 seconds, 30 seconds and 60 seconds, here is the code so far. Timer.java import javax.swing.*; public class Timer extends Thread { private int waitTime; private JPanel … | |
How do i debug the application attached consisting of four Java classes [code] *************** Pictures of screen shots to go here ***************** Color.java public class Color extends Object { private String color; public Color() { return setColor( "" ); } public void setColor() { color = "black"; return color; } … | |
My task is to code an applet that should take 2 fractions and either add, subtract, multiply, or divide them (depending on which JButton the user uses). Then, the fraction is to be converted to lowest terms. Also the fractions will be entered in in terms of 2/5 for "two-fifths". … | |
i am trying to have macromedia flash button send a double or a symbol like (+, =, &) to a java program. the java program will save the input on an arraylist. while the flash button sends doubles it simply puts them on the arraylist, but if a symbol comes … | |
i am trying to have macromedia flash button send a double or a symbol like (+, =, &) to a java program. the java program will save the input on an arraylist. while the flash button sends doubles it simply puts them on the arraylist, but if a symbol comes … | |
I have to do a basic program of a calulator(text field at top for display and then all numbers) it does not have to be funtional. I know you can only have one layout manager per container...but I can't get it to work? This is what I have so far..any … | |
having trouble getting this match and replace to work, im trying to just find a word and put html bold tags around it on the button click and put that text into a new jtextpane. anyone have any suggestions??? any help would be most appreciative [code] import java.awt.*; import java.awt.event.*; … | |
Hi, The following code compiles and runs fine from the hard drive but does not compile fine from a floppy disk. It gives me a cannot resolve symbol error for the DataSet dataSet = new DataSet(); line. Any ideas? The program is supposed to except user input for 4 integers … | |
im trying to call a showInfo() method from a superclass MediaTypes, the subclass is CD and the driver class is Assn2. the problem im having is that for all the values i inherit from the MediaTypes class im getting only null values and for the gregorian date im getting a … | |
HELP.. I have a frame set to the screen size of my monitor, background color is yellow. I have a panel returned by midFrame() (outerPanel) supposed to be located at the center of my frame. i used the setBounds() to place my panel in the center but it doesn't do … | |
I'm trying to get a 'fish' to move randomly within an aquarium. I've got the fish drawn, but can anybody help me on getting him to move randomly? Any help would be greatly appreciated. -- Shipwreck import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.*; public class Fish { public static … | |
![]() | hi all the purpose of this simple codes is to show a text in a text box when i click the button. Both are on in different panel and then placed in one main panel with box layout... actually, i made it a simple case... still, the prob still exists... … |
Dear all, I am a newbie in JMF and just got a problem in running my first JMF java program. I wanted to create a player and play some video. And I happened to get some code which could run properly. But after my further exploration, it seems that I … | |
how do i make the number of my textfileds dynamic? the number of my textfield depends on the parameter passed through the method `setDetailsPanel(int s)`. the variable s determines the number of textfield i need. i'm having this type of error. i don't seem to get the reason why. D:\Program … |
The End.