3,978 Topics

Member Avatar for
Member Avatar for rayda

[ICODE]public class fermi { private int[] guess; private int[] random; private int total; public fermi(int[] gs, int[] rn) { guess=new int[gs.length]; for(int i=0;i<gs.length;i++) guess[i]=gs[i]; random=new int[rn.length]; for(int j=0;j<rn.length;j++) guess[j]=gs[j]; total=0; } public int totalPlay() { return total+=1; } } [/ICODE] [ICODE]import javax.swing.JOptionPane; import java.util.Random; public class playFermi { public static …

Member Avatar for verruckt24
0
126
Member Avatar for Caled

Hello Experts, I need to use JOptionPane a lot in my Java exercises. Instead clustering each Java files with this JOptionPane syntax plus the parameters, I've decided to use sort of class called showFrame which has the method to show message dialog and input dialog. At the moment, im putting …

Member Avatar for stultuske
-1
443
Member Avatar for Valkerion

Greetings from Greece. We got a Hangman assignment for my Class at Java. I m just a begginer.And the whole input/output thing is done either by console (system.out.println) or with JOptionPane. So here is my code [code] import javax.swing.JOptionPane; import java.util.*; public class Hangman { public static void main (String …

Member Avatar for blog_user
0
1K
Member Avatar for goyofoyo

i am working with a piglatin translator that has a GUI but i am stuck on how to make it translate when i you push the translate button here is my GUI what is in red is were the error occurs if someone could help i would appreciate it thanks …

Member Avatar for Ezzaral
0
295
Member Avatar for nanna

hi, Iam trying to add names and numbers to a database then save them by updating them. i run my program, but when i press any button nothing happens????? pls help me, i do not know where is the problem in my program???? [CODE]import java.awt.*; import java.awt.event.*; import javax.swing.*; import …

Member Avatar for nanna
0
326
Member Avatar for chetan08_01_87

hi, I have an application that plays video files using jmf It plays some videos but without audio but while playing some videos the application automaticaly terminates and generates runtime error. A log file is created by name hs_err_pid2232.log which have following message: # # An unexpected error has been …

0
60
Member Avatar for AirmanTheGreat

OK. So this program is supposed to prompt the user whether they want to play the guessing game. If they say no then end the program otherwise it will start the game and ask them for their first name, last name and the number of guesses they want. Then it …

Member Avatar for AirmanTheGreat
0
101
Member Avatar for denniskhor

[code] import javax.swing.*; import java.awt.*; import java.util.*; import java.awt.event.*; import java.io.*; public class PartOfSpeech extends JFrame implements ActionListener { private JButton btn1,btn2; private JTextArea txtAreaArticle; private JTextField txtField1,txtField2,txtField3; private JMenuBar jmb; private JMenu fileMenu; private JMenuItem out; public PartOfSpeech() { setTitle("PART OF SPEECH SYSTEM"); Container con=getContentPane(); con.setLayout(new BorderLayout()); jmb=new JMenuBar(); …

Member Avatar for denniskhor
0
80
Member Avatar for akshay.sulakhe

hello friends...started to learn python and have covered the basic stuff and some silly gui stuff...i currently have some time so i thought why not prepare a app in python with some killer gui..now java has swing which can be modified to make such GUI...so is there anything which can …

Member Avatar for scru
0
130
Member Avatar for eD_2525

Hey Everyone! My name is Ed and I am new to programming and your community. Thanks for the warm welcome and I hope you can follow me with my coding problems. My code is for a project that simulates a simple vending machine. When the program is run three buttons …

Member Avatar for BestJewSinceJC
0
730
Member Avatar for c0dex

Hey all, for quite some time I've been working on an inventory management program for work, and I'm having a bit of an issue with the rendering of a JFrame notification window, I'll do my best to explain below (including screenshots). So my program works with a remote FTP server …

Member Avatar for JamesCherrill
0
204
Member Avatar for Lilal

Hey all, I'm having problems with a project I'm doing, I've started rewriting a project I'm doing as I ended up using too many arrays instead of classes >.< And running into some silly problems: Everytime I run the program I get this error on compilation [COLOR="red"]java.lang.NoSuchMethodError: main Exception in …

Member Avatar for BestJewSinceJC
0
109
Member Avatar for deerowbear

I am trying to update a jlabel, but the label is not updating. Thanks for any help. Daniel [CODE]package converter; import java.io.*; import java.awt.*; import java.awt.event.*; import java.util.ArrayList; import java.util.Iterator; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.*; import javax.swing.filechooser.FileFilter; public class modelConverter extends JFrame implements ActionListener, ItemListener { // Data panel …

Member Avatar for deerowbear
0
116
Member Avatar for regent_royal

I am currently working in one swing application. I need to display html contents in some window. In swing we are having [B]HTMLEditorPane [/B]that can display HTML contents on window (not in browser). Now this HTML contents is not well structured. like starting and ending with html tag inside it …

0
60
Member Avatar for trelek2

Although I'm a novice in Java I am to make a pool simulator in java with the ability to handle any arbitrary number of balls (i have created a Ball object, balls will be stored in the Ball array called balls). All the parameters are to be read in from …

Member Avatar for BestJewSinceJC
0
245
Member Avatar for babywen

my program doesn't display the shapes after the button is clicked .. can someone help me with this .. import java.awt.*; import javax.swing.*; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; public class DrawShapes extends JFrame { public DrawShapes() { JPanel panel = new JPanel(); final JButton circle = new JButton("Circle"); JButton square = …

0
43
Member Avatar for jooa

Hi I am trying to implement the Fast Fourier Transform. I have some code which I got online and slightly modified. I have a class GrabPixels which extracts a pixel array from an image, the class FFT implements the transform. My problem is I don't think the methods in the …

Member Avatar for JamesCherrill
0
403
Member Avatar for MarMcD

Hello, Can anyone please help me... I need to create a GUI program that holds product inventory. I have five errors and I can't figure out what they are... I need a second look from someone... Thanks in advance! [code] import javax.swing.*; import java.awt.*; import java.text.NumberFormat; import java.util.Locale; public class …

Member Avatar for MarMcD
0
160
Member Avatar for azket

Hey everyone, let me get straight to the point: For my program I developed two custom classes that extend jPanel and have some text fields and check boxes in them. (public class ServicePanel extends java.awt.Panel) Now I've encountered three problems. 1. When add those panels to the GUI Palette and …

Member Avatar for azket
0
120
Member Avatar for smoore

Okay I am writing a program that, in the end, will bring up a GUI window and ask the user what type of shape they want to make. The choices are line, circle, ellipse, rectangle, and polygon. When the user selects a shape they are then asked some key information …

Member Avatar for smoore
0
1K
Member Avatar for Ratte

I am in the process of designing a game implementation in Java, and without much experience with GUIs past swing applications, I am not quite sure where to start with this. The game I will be implementing can be seen and played here: [url]http://www.pentago-online.com/[/url] In other words, it is board …

Member Avatar for stephen84s
0
135
Member Avatar for kjetil4

Hi, Im trying to make a media player in Eclipse. Its just a simple thing not an advanced one but i cant get it to work. I have looked at some examples and tried to create a simular version. I could really use some hints on how to make it …

Member Avatar for kjetil4
0
618
Member Avatar for VernonDozier

I have a program that is supposed to draw circles every twentieth of a second every time a button is clicked. When the button is pressed, a function is called and a for-loop is executed 25 times. Within that for-loop, [ICODE]repaint ()[/ICODE] should be called. Within the [ICODE]paintComponent[/ICODE] function, random …

Member Avatar for VernonDozier
0
547
Member Avatar for tmoney7566

I am trying to write an applet that receives 2 inputs from a user then opens a window and displays the 2 numbers that were input, along with a message of either "the numbers are equal", or "this number is the largest". My problem--my program never returns "the numbers are …

Member Avatar for tmoney7566
0
138
Member Avatar for VinceAshbySmith

Hey all wonder if you can spot my mistake or point me in the correct direction. I'm new to Java applets after spending quite some time learning/using standard applications. This simple program is basically converting a standard application into an applet, but for the life of me i can't see …

Member Avatar for VinceAshbySmith
0
141
Member Avatar for devonte15

import javax.swing.*; import BreezySwing.*; public class PaymentDDJ extends GBFrame { //Declare variables for the window objects.// private JLabel purchasedprice; private JLabel name1; private JLabel downpayment; private JLabel interestrate; private JTextField nameField; private JTextField purchasedpriceField; private JTextField downpaymentField; private JTextField interestrateField; private JButton enter; private JTextArea balance; //Define the other instance …

Member Avatar for verruckt24
0
209
Member Avatar for sciwizeh

Hello, this is related to [URL="http://www.daniweb.com/forums/thread177461.html"]the last thread I posted[/URL], but it is also different. I found something about ImageObserver with a google search and can't find much on it, I tried doing what the site on google did, but it didn't work with the simple test I wrote. here's …

Member Avatar for sciwizeh
0
689
Member Avatar for SADIYA4

hey how to make an object move in an C graphics program, eg; i have drawn a swing and i want it to move... i am beginner in C graphics program so please help me...:(

Member Avatar for csurfer
0
56
Member Avatar for jhowardsandy

Hello, I am trying to write a simple program that takes input from the fields I have created for the following UI and writes them to a command prompt. Can someone help me with the next step.... getting the input entered and writing it to the prompt? I would also …

Member Avatar for jhowardsandy
1
101
Member Avatar for jo8594

Ok, here is the problem. I have to ask a group of people for donations and get the total average and so on. The only problem I have is trying to get the lowest donation from the inputted numbers. I can't seem to get the actual lowest number. It just …

Member Avatar for sillyboy
0
132
Member Avatar for curtissumpter

Hi, Everything else in this code works properly but the keyTyped method is not working properly. I have been working on this for sometime. Any help would be appreciated. Also, any advice on getting my southPanel to appear when I start the application? It appears but only after I expand …

Member Avatar for sciwizeh
0
139
Member Avatar for tlmiller9278

Hello, this is my first post here and I noticed that other people have been struggling with this assignment too. It is the mortgage calculator program for UOP PRG420. So I am sure you all are probably about sick of this by now, but I need help. The book is …

Member Avatar for JamesCherrill
0
146
Member Avatar for l_03

[code] package Sorting; import javax.swing.JOptionPane; public class Sorting2 { public static int s[] = new int[100]; public static void main(String[] args) { String ask = ""; for (int i = 0; i< 5;i++){ ask = JOptionPane.showInputDialog("Enter: "); s[i] = Integer.parseInt(ask); System.out.println(s[i]); } for (int x = s.length-1; x>= 0; x--) …

Member Avatar for JamesCherrill
0
134
Member Avatar for Narayan15

Hi, How to add image to Jwindow. Here is my code: import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.text.*; import java.io.*; class Project4 extends JWindow { Container container; JTextField jt; JButton jb; public Project4(String st, final Image image) { container = getContentPane(); container.setLayout(new BorderLayout()); //JTextArea jtp = new JTextArea(st,10,10); //container.add(sp); …

Member Avatar for Ezzaral
0
487
Member Avatar for starsinthesky

hello. i have a problem running my very first applet (im just converting my previous application to applet). i tried to follow the instructions i found in the manuals, both the one given by my prof and the ones i found in the web, but unfortunately my program wont work. …

Member Avatar for starsinthesky
0
127
Member Avatar for trueinam

Dear Members I am having a problem in Java and I am pasting the code and the error message please tell me where is the problem and aslo tell me any directory that can guide me about frequent error messages and their solutions. here is the code. import javax.swing.*; import …

Member Avatar for stephen84s
0
111
Member Avatar for dbwalters

Hello, I was hoping that someone might be able to help me with this program: [code] import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.text.*; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.io.FileNotFoundException; public class CustomerInfo extends JFrame implements ActionListener { //construct components JTextPane textPane = new JTextPane(); //initialize data in …

Member Avatar for hrdzdier
0
828
Member Avatar for britto

im creating an IDE for jswing what i need is the user must drag and drop swing controls ex: (TextField, JList ...) into a tab in tabbed pane dynamically hw to do this....

Member Avatar for Ezzaral
0
61
Member Avatar for nanna

hi, iam trying to create phone directory as a seperate Jframe. there is a button in the main JFrame that leads to the seperate Jframe. the seperate Jframe contains JList which includes names and numbers. when click on any name from the list, this name with the number should appear …

Member Avatar for verruckt24
0
222
Member Avatar for curtissumpter

Hi People, I am trying to run this file but I am having trouble getting the program to incorporate the gif file that I need. Here's the program. // Demonstrating JDesktopPane import javax.swing.*; import java.awt.event.*; import java.awt.*; public class DesktopTest extends JFrame { public DesktopTest() { super("Using a JDesktopPane"); JMenuBar …

Member Avatar for danielernesto
0
885
Member Avatar for l_03

[ICODE] import javax.swing.*; public class Tokenize{ public static String s[] = new String[100]; public static void main (String args[]){ String ask = JOptionPane.showInputDialog("Enter:"); isAsk(ask); } public static void isAsk(String ask){ StringTokenizer st = new StringTokenizer(ask," ",false); int input = Integer.parseInt(st.nextToken()); if(input<=10&&input>=0){ System.out.println(input); } } } [/ICODE] Here is the sample: …

Member Avatar for verruckt24
0
170
Member Avatar for mic2x_caspe

ah im in 1st year IT student, my project is about to make a Notepad and it should have an event to perform. example: is when i go to [B]"file"[/B] then click the [B]"save"[/B] and it will perform.. pls give some example of class that use an event.. Im new …

Member Avatar for verruckt24
0
153
Member Avatar for Carnelian

In the following codes, I only specified the user to input only 4 numbers in the textfield. I want to output the numbers inputted by the user but I don't know how to do it seeing that the "text" and "value" is different in a formattedtextfield. All I see in …

0
48
Member Avatar for r.stiltskin

I have two problems with the focus on buttons in this project. I've pared the code down to barebones to show the problems; there are only 2 simple classes remaining & still the problems persist. It compiles, runs (java ColorView), and all that's required to see the problems is simply …

Member Avatar for r.stiltskin
0
88
Member Avatar for rayda

[CODE]import javax.swing.JOptionPane; import java.util.Random; public class guess2 { public static void main(String[]args) { int num; int guess; int diff; String input; int Diff; Random randomNumbers=new Random(); guess=randomNumbers.nextInt(100); diff= num - guess; Diff=Math.abs(diff); input=JOptionPane.showInputDialog("Enter your guess."); num=Integer.parseInt(input); for(int i=0; i<5;i++) { while(num<0 || num>100) { input=JOptionPane.showInputDialog("Invalid number!Please re-enter: "); num=Integer.parseInt(input); if(Diff==0) …

Member Avatar for ~s.o.s~
0
315
Member Avatar for curtissumpter

Is it safe to assume that any object that is preceded with the letter 'J' is a member of the Swing package? Just trying to get lightweight versus heavyweight components sorted properly. Thanks. -- Curtis

Member Avatar for verruckt24
0
89
Member Avatar for trelek2

Hi! I'm a newbie in drawing graphics with Java and have another problem with my traffic Jam simulation: At the end of the simulation the program should draw the finalA array as a series of filled/unfilled squares. All I get is a white window coming up:@ I will post all …

Member Avatar for Ezzaral
0
133
Member Avatar for sweetsilverrain

I've somehow lost the concept of the easiest part of this assignment... OK, We have a program which draws random rectangles based on mousePressed and mouseReleased coordinates. I am adding a Circle class which draws circles as well. I have the class written, the draw method written but now when …

Member Avatar for sweetsilverrain
0
225
Member Avatar for tksrules

I need to design tabs shown in the attached document. I designed some but need your help with the rest. Could you create them using 'Pools Tab' code as a blueprint so the programming outline in all the tabs look similar if at all possible? Password for the document is …

Member Avatar for rapture
-1
116
Member Avatar for arseniew

Hello I'm working on simple text editor based on jTextPane i have no problem setting text color, size, font etc. but i have no idea how to get attributes from selected paragraph. i'v tried doing it by [CODE]myPane.getCharacterAttributes().getAttribute(key));[/CODE] but what shoud be the key? any help would be appreciated

Member Avatar for sillyboy
0
60

The End.