3,978 Topics
![]() | |
Hello and good evening everyone :) I've written up a program that counts the number of times each number on a die (dice) is rolled, with the percent. Only thing is, I'm not quite sure how to output the percent. Everything else seems to be working except that part... What … | |
Hi Guys, I was doing a Mail Program and Got stuck in the following questions. I don't know How to approach. 1. Right Click pop Up Menu for Attachments List and adding pop up listener for this. Some kind of a right click context menu for each item in the … | |
My tic tac toe board is done, but I need it to show up in the Dialog box, not the console, how would I do that? Here is my code: javax.swing.JOptionPane.showMessageDialog(null, "\n-------"); for (int i = 0; i < 3; i++) { System.out.print("| "); for (int j = 0; j … | |
I am a student and have to submit a Mail Program. I have been asked to do the program using [B]GridBagLayout[/B]. The program is working fine but for the Layout. I just am not able to manage the layout problems I am facing in this program. Could I get some … | |
Hi all, i'm new so not sure if this is the right place or not. But none the less i'm hoping someone can put me somewhere in the right direction! Basically i'm wanting to know is it possible to open ax existing exe? to create further add-ons to its existing … | |
There isn't exactly anything wrong with my code, it's fine although the order isn't correct, I think, which makes my shapes appear behind the center panel. I'm not sure how to correct this as I've drawn my shapes under a paint method. I've tried moving the paint method before and … | |
I am looking to create a system to take a function in a Swing GUI, parse it, and produce a graphical result. This includes using such unicodes as Sigma and Omega to be read into a Swing Component (currently I have a JFormattedTextField). The most ideal is to highlight and … | |
import javax.swing.JOptionPane; public class conversionweight { public conversionweight() { String ans; ans = JOptionPane.showInputDialog(null, "Enter Weight in Stone.Pounds" ); double stones = Double.parseDouble(ans); double pounds = 14 * stones; double kilos = 0.45359237 * pounds; JOptionPane.showMessageDialog(null, " weight in Kilos = " + kilos); System.exit(0); } } my task was … | |
I need to this program to let me enter in an letters A B C or D so this program can run, why isn't this program not working, please help. Here is my code: public class DriversLicense{ public static void main(String [] args) { //Students answers to the questions char … | |
Hi, I am a first Year Computer Science student learning java. First, what I want help with is not a homework assignment, I just started it on my own. This program is supposed to test the "Chaos Game" The chaos game is explained here: [URL="http://mathworld.wolfram.com/ChaosGame.html"]Chaos Game[/URL] So, the basics that … | |
My assignment requires that I use exception handling to create a directory and file if necessary. I was able to create a C:data\inventory.dat file, provided that there's an existing Data folder (directory) in my C: drive; however, I have a feeling that the assignment wants me to create an actual … | |
My delete button is not working and my due date is Sunday before midnight. Can anyone show me how to correct this error. My assignment statement is below as well as 5 classes. InventoryGUI is the main class to begin execution. I have a Data folder that contains my logo … | |
Hi da, Suggest me good books for Swing and JDBC(apart from Sun tutorials -which I will use) . I have basic knowledge of Swing which I read from Head First Java but I don't know anything about JDBC. Now I want to explore my knowledge in Swing and I'm going … | |
I'm trying to practice writing a program which creates an object and does various tasks. So far the tasks I want to program to do are to take a hypothetical triangle (it doesn't draw a literal triangle on the screen; it just shows the number of triangles there, the area … | |
Lemme first greet all my beloved fellows and i would love to give you all credits for helping each other with problems concerning java!!! I have a problem with listening methods in my code.the only respond i get is the exit part of my buttons....please i would be happy to … | |
Hi Everybody, I wrote below codes which check textfiled and comco box for equals. But i want write a integer in textfiled and check it with combobox; For example When i write in texfiled 10 in the 10. on combobox is Balıkesir so if i select Balıkesir it's true but … | |
I am getting an error message "Exception in thread "main" java.lang.NoClassDefFoundError:Projectta import javax.swing.*; import java.awt.*; import java.awt.event.*; public class projectta extends JFrame { private static final int WIDTH = 400; private static final int HEIGHT = 300; private JLabel directionsL; private JtextField textTF, messageTF; private JButton submitB, resetB, exitB; private … | |
Hello folks, I have a program that uses a linked list to implement a stack to convert a string from infix notation to postfix notation, and then to evaluate it. Well, the conversion part works just fine, but I have encountered a problem when trying to evaluate it. In my … | |
Can some one help making reports in swing | |
Hi, I am relative new to Swing development, so please be patient... I have created a scrollable table and would like to add (at runtime) a JComponent (for example a chart linked to the table) that would sit on top of the table and would also scroll aong with the … ![]() | |
I am newer to java and working with JFrame for the first time. This is what I have wrote so far. import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.io.*; public class contact extends JFrame implements ActionListener { public contact() { ImageIcon usIcon = new ImageIcon("image/usIcon.gif"); JTextField First = new JTextField(10); … | |
I am new to java and having issues. package components; import java.awt.*; import java.awt.event.*; import javax.swing.*; /* FrameDemo.java requires no other files. */ public class ContactApp { /** * Create the GUI and show it. For thread safety, * this method should be invoked from the * event-dispatching thread. */ … | |
Hi, I'm an IT student taking up web site development. One of the courses we are taking is Java. Anyway, I have been trying to change two String arrays to Boolean's. I keep getting errors all the time, and am at my wits end! Could someone show me how to … | |
Hello , I have a java program that genrates a family tree using swing and I want to use that in my JSP page.For which I have convert it into an Applet.Can anyone tell me how to convert it into Applet or any other alternate solution. | |
...kindly help me with this..........my code doesn't work.... ...create a program that will ask questions and at the end of the session it will display the total number of correct answers and the equivalent grade.... ...thanks..... import javax.swing.JOptionPane; public class questions { public static void main(String[] args) { int score=0; … | |
This program will build/compile but not run. I get an error message [B]Code:[/B] [CODE] java.lang.NoClassDefFoundError: midterm1/Main Exception in thread "main" Java Result: 1 [/CODE] Now I am very new to java and all of the logical errors and messages that come with them. Please bare with me. Can anyone take … | |
Hello I am making a "Superclass" that provides a programmer easier means of constructing a java panel by providing a template so as not to reuse code over and over. I have reached a point where I am trying to allow the programmer to call one method with in my … | |
Credit card(parent)Debitcard(child). At the file menu if you choose "credit"+"new Account" the parent works fine. At the file menu if you choose "debit"+"new Account" the child does not work. I am haveing trouble creating a new object which is the debit class which uses its super (credit class) Can any … | |
I needed to get links to some good Java, J2EE tutorials and was surprised that daniweb::Java didn't have a thread on that.. Of course it's easy enough having Sun provide tutorials on most things, there might be some covering specific topics in better ways. Anyway here are the links I … | |
Hi! Haven't posted on danniweb for awhile, but I'm hoping I can get some help. I am in the middle of learning Java, which will be my second language after python, and I have come across a problem, ordering a list of integers in an array. In python, there's a … | |
ok the goal of the project is to define a class called DateCS212 and use an array of DateCS212 objects to store a sequence of dates. The main program, Project2.java, will read the dates from a file and will instantiate a DateCS212 object for each date read from a line … ![]() | |
Ok, so my goal is to draw a rectangular spiral in java. So far, I've created the Spiral Viewer class and the SpiralComponent but I'm not quite sure how I would implement the SpiralGenerator class. Here's what I have: SpiralViewer: [CODE]import javax.swing.JFrame; /** Test driver for Spiral class. */ public … | |
hi, I seem to gotten my code run. But what I want is to display everything into a dialog box all at once. So when I type 3 it would display all the factorials starting from three...to 15 and display them according to number / Factorials. 5 to 15 all … | |
I am trying to print this to a dialog box. The code prints to console and prints, 1,2,3,4....12 to the dialog box. Can someone give me some advice on printing to a dialog box the verses to the dialog? [INLINECODE] import javax.swing.*; // program uses class JOptionPane public class TwelveDays … | |
My assignment is: "Write a program that accepts the letter grades for a student, calculates the student's gpa, and prints it out, along with one of the following five messages: Eligible Ineligible, taking less than 4 classes Ineligible, gpa below 2.0 Ineligible, gpa above 2.0 but has F grade (note: … | |
[B]the below code is to list the running exe files in the windows task manager. but i need only the running applications in windows task manager. if aybody knows pls help me by sending code for this. i am awaiting pls.[/B] import java.io.*; import java.util.*; public class GetProcess { public … | |
I don't know why I'm spacing out tonight, because I've been doing fine, but I'm stuck on one thing. I've already written the first part of my program (get integer input from the user, then calculate the product, and display), but the second part (not required, but I thought I'd … | |
Good Morning! I am trying to create a Book2 object and assign to Inventory_Program6a. When I try the following: Book2 newBookTitle = Book2(); I get the error message: C:\java>javac Inventory_Program6a.java Inventory_Program6a.java:325: cannot find symbol symbol : constructor Book2() location: class Book2 Book2 newBookTitle = new Book2(); ^ 1 error I … | |
Hi all , I tried one simple animation in Swing . Here's what the program has to do : when a button called "play" is clicked a circle should be moved from upper left corner down to the lower right corner. [code=java] import javax.swing.*; import java.awt.event.*; import java.awt.*; public class … | |
/*This is a what I've written so far- see below.*/ /*The program is to ask a user to insert values into array, print those values showing both index # and corresponding value, return average, min, change value of 1 array element, delete 1 element, compact the array. ALL these MUST … | |
Hello Everyone, I feel like I'm going around in circles! I can't figure out why by JButtons won't perform their assigned functionality. I have a first, previous, next, last, and save button. I've created actionListeners and actionEvents for all butons, but they still produce nothing. Any insight is extremely appreciated!!!! … | |
okay I have been working on a little project of my own for a while. At the moment it prints out the chapters read and once 100% of the chapters read is greater than 100 it shows on the next line of my code the number of times the book … | |
I'm trying to simulate a typewriter effect in an applet. I have a main box and input box which I want to copy the input text letter by letter in to the mainbox. The problem I'm having is when I try to sleep it sleeps the whole time then prints … | |
Hi all, I'm a beginner in JAVA studying SWING. I learned that if we want to handle an event for a event source(say JButton) we should implement corresponding Event Listener(say ActionListener) . I also understood that we should register the Listener with that event source. With that knowledge I tried … | |
(// See my program below-after the question) The program is supposed to do the following: Repeatedly offer the user the following 10 menu options (they must enter the option number): (1) insert n values in the array, starting with position 1. (2) insert n values immediately after the last entered … | |
I need to Modify the Inventory Program by adding a button to the GUI that allows the user to move to the first item, the previous item, the next item, and the last item in the inventory. If the first item is displayed and the user clicks on the Previous … | |
[COLOR=Green][B]need help with my java calculator, about the key listener. its allows me to input using keyboard. but the answers are always "ERROR".. but when i try to use the mouse. it works fine. having problem with the keylistener. please help CALC [/B][/COLOR][code] import java.awt.*; import java.awt.event.*; import javax.swing.*; import … | |
I am now taking Java classes and I have worked this program out, but it is giving me a "illegal start of type" on my code and I do not know why please help. Thanks for your help. [code] // Displaying multiple strings import javax.swing.*; // to use JOptionPane.show InputDialog … | |
Here is my code for an applet in java it runs well but shows error unreported exception java.io.IOException; at the functions highlighted in green I wanna ask the functions i've highlighted highlighted in green in code are supported in applets? Thnx in advance /* * Java(TM) SE 6 version. */ … | |
One of the things that's been confusing me so far is why we have to override the paintcomponent() function after extending it. For example, this program draws an ellipse: [CODE]import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.geom.Ellipse2D; import javax.swing.JComponent; public class DrawEllipseComponent extends JComponent { public void paintComponent(Graphics g) { … |
The End.