3,978 Topics

Member Avatar for
Member Avatar for Chitru

i was coding GUI in Java. i'm just a beginner and i can't figure out on what program is mistaken please help me on this: [B]Compilation error is:[/B] helloworld\FourthApp.java:38: class, interface, or enum expected public static void main(String[] args) { ^ helloworld\FourthApp.java:40: class, interface, or enum expected } ^ 2 …

Member Avatar for masijade
0
649
Member Avatar for sumprit

hello everyone, i am using OSM in a swing application. Now what i needed is that when i clicked the mouse then it must perform Zoom in/out on the OSM. i could not able to perform the actionClick action for the mouse. How can i able to do it. If …

Member Avatar for sumprit
0
112
Member Avatar for rosey_fci

hi everybody I have a little problem I can not fill all the cells in the table that I made by java swing can anyone help me

Member Avatar for mKorbel
0
63
Member Avatar for kesh1000

hi can anyone tell me why the netbeans ide generates a null pointer exception. here my code. for class CustomFileFilter [CODE]import java.io.File; public class CustomFileFilter extends javax.swing.filechooser.FileFilter { private String extension; private String description; public void setDescription(String description) { this.description = description; } public void setExtension(String extension) { this.extension = …

Member Avatar for kesh1000
0
184
Member Avatar for cwarn23

hi, I have the following code and it compiles on Netbeans with no errors or warnings but when I load the applet in a browser the browser does not display all of the pictures that I got it to draw. The only picture it draws is my_gif. I have tried …

Member Avatar for cwarn23
0
211
Member Avatar for jdm

I'm working on a simple program, but I help with a part of it. When I click the submit button I need the name field to be cleared and for all of the checkbox to be unchecked. I have the name field done, but I need help with unchecking all …

Member Avatar for jdm
0
2K
Member Avatar for TrustyTony

Here is experiment of how VM and Swing UI manage the sort test posted previously, instead of CPython and Tkinter. The timing is not so sweet, but at least no Java required! [CODE]K:\jython2.5.2>java -jar jython.jar swing_test.py 256000 words generated in 10.93 s Sorted in 1.68 s List prepared in 22.71 …

Member Avatar for TrustyTony
0
506
Member Avatar for jason75080

This program accepts input in the form of a String of names and grades. It picks out the names and picks out the grades and puts them in seperate arrays. Then it needs to output them together sorted by grades and then by names. I can get the Grade Order …

Member Avatar for jason75080
0
5K
Member Avatar for MrHardRock

Hey everyone, I am writing a GUI that allows a person to enter all their own numbers into an array, then they can search the array for any number they want. I have it almost completely written except for two compile errors I can't figure out The first one is …

Member Avatar for mKorbel
0
172
Member Avatar for rjdelight

I'm trying to display some text in a JTextArea I have set up in a simple GUI. Easy right? That's what I thought, but I'm clearly not that advanced at Java. The hook is the information I want to display in the JTextArea is in a text file (file.txt). Right …

Member Avatar for mKorbel
0
1K
Member Avatar for smokin745

I have implemented the addActionlistener for the Add Contact button in this GUI setup (please try running this code in your computer to know what i am talking about) and when i click on Add contact, the new frame pops up, i enter the details in the New contact frame, …

Member Avatar for smokin745
0
180
Member Avatar for zach&kody

How do you override a superclass's methods with a subclass? These are my two programs, the first being the super class, and the second being the subclass of which I am attempting to override the superclass's methods. [CODE]// This class represents a walker with two feet. import java.awt.Image; import java.awt.Graphics; …

Member Avatar for rubberman
0
212
Member Avatar for sariberri

My program needs to tell whether two Students were selected, and if so I need to output to the screen their averages. I got the first specification which works for only one selection (just shows grade) but I have no idea to tell whether they selected two from the list... …

Member Avatar for sariberri
0
181
Member Avatar for SMITA6076

[B]For the error and my question, skip to the bottom. I just posted all of the code in case it's needed.[/B] [CODE]/*********************************************************************************** * * File: Customer.java * * Author: Austin Smith * * Date: 04/04/2011 * * Description: The Customer class handles all client information * such as name and …

Member Avatar for SMITA6076
0
254
Member Avatar for Mkmd13

Hey I am almost done with my hangman game for java but Im having a tough time in getting the last bit of it. I have included ALOT of comments for you guys to help me out with it. [CODE]import java.io.*; import java.util.*; import javax.swing.*; public class Hangman { public …

Member Avatar for VernonDozier
0
183
Member Avatar for HelloMe

Hello guys... I have a strange problem on my calculation for a First in First Out Algorithm. The problem is, when i have to calculate 4 processes and above, the waiting time on my processes are wrong, but when i have to calculate only up to 3 processes it is …

Member Avatar for HelloMe
0
105
Member Avatar for rjdelight

Hi all, I'm trying to get the information from a text file to show up in the JTextArea I have in a GUI. I'm using the GUI editor in NetBeans, because I'm a Java newb. I've been reading a lot of things on the web and can't seem to figure …

Member Avatar for sirlink99
0
3K
Member Avatar for joseph.roy9

i hav developed a java swing desktop application in eclipse & ubuntu;From where should i get the jar file of my appication or how to create jar file of my application??? thanks in advance...........

Member Avatar for JamesCherrill
0
213
Member Avatar for keiteqq

if a word begins with a vowel (a-e-i-o-u), then "ay" is added to the end of the word (so "idle" -> "idleay", and "often" -> "oftenay"); on the other hand, if a word begins with a consonant, then the first letter is removed, and is placed at the end of …

Member Avatar for keiteqq
0
500
Member Avatar for SeanC

Hi all, I'm currently trying to solve a problem with a JList. I've got an actionPerformed event applied to the JList (also tried the item updated event but it has the same effect), and whenever this event is fired, (i.e. the user makes a selection), something happens. Now, the problem …

Member Avatar for Ezzaral
0
406
Member Avatar for HelloMe

Hello everybody...!!! I got a little but bothering problem. I create a First in First out algorithm schedule but somehow i have a problem in computing the WT(Waiting Time). Actually i have a WT but it only considers the current AT(Arrival Time) of the current process and does not include …

0
87
Member Avatar for MWE_QUE

This JFrame opens and puts in the empty questions and answers when it starts as it should, but it doesn't print the questionList.size() at line 191. The next button also won't go to the next question which should be retrieved from the text file. I'm not sure if the questionList …

Member Avatar for MWE_QUE
0
239
Member Avatar for SCass2010

Hi everyone, I have an ArrayList containing 40 or so JPanels for a board game developed in Netbeans with java - is it possible to have an event listener or something similar that will "monitor" the ArrayList for any of the JPanels being clicked, rather than having to create an …

Member Avatar for SCass2010
0
1K
Member Avatar for jasperFernandes

Hi, i wanted to create a JTextField to receive the user input instead of having the user key in the input through the IDE console. This is my code. Now, my code just runs fine if the user key in the inputs through the console. After running the code, the …

Member Avatar for mKorbel
0
2K
Member Avatar for Jaily

I'm trying to make a digital clock in Java. The program is at the end going to be an alarmclock. So far I've made 3 classes: Main, Clock and Time. Main only creates an object of Clock. Time handles the javax.swing.Timer function for the clock. And the Clock creates a …

Member Avatar for mKorbel
0
491
Member Avatar for ekin5683

[CODE]mport java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import javax.swing.*; import java.awt.*; import javax.swing.ImageIcon; import javax.swing.JApplet; import javax.swing.JButton; public class Main extends JApplet implements ActionListener,ItemListener { //private Image im; // image handler //private static final String IMAGE = "enviro2.jpg"; //starFish tapakSulaiman = new starFish(this); public void init() { …

Member Avatar for mKorbel
0
437
Member Avatar for sariberri

I need to add a border around the Size label and the small, medium and large buttons so I thought I would add them into their own Panel and then add that panel to the mainPanel but when I do that they do not show up. What am I doing …

Member Avatar for Ezzaral
0
298
Member Avatar for Taimoor Rana

hey guys, I drew many lines for the purpose of my project but for some reason, I cannot draw this specific line[U](code line 44)[/U] and cannot figure out why. Note: I have debugged the code and this code line is red by Java but it's not applied to the graphic. …

Member Avatar for Taimoor Rana
0
144
Member Avatar for joseph.roy9

hi, i want to develop a java swing application for searching names in the database; how can i get names which starts with a particular aplaphabet; ex.'j' ans:joseph john etc........ plz help me thanks in advance

Member Avatar for Ezzaral
0
64
Member Avatar for Akins72

[CODE] /* Programmer: Date: March 30th, 2011 Filename: DiceGame2.java Purpose: Java program that lets the player roll 5 normal 6 sided die. The player gets to choose which of the die to keep or which to reroll - explains it in messages to the player. Reroll the selected die not …

Member Avatar for Akins72
0
207
Member Avatar for Carrots

Hi there, I'm completely new to Java. I am trying to use [I]import[/I] in a project, but despite using what I think is the right code, my application fails to build. When I build my app, it builds and runs fine, but I want to use [I]JFileChooser[/I], so add this …

Member Avatar for Carrots
0
109
Member Avatar for MisterSinyster

Create a constructor for the Delivery class that accepts arguments for the year, month, and delivery number within the month, delivery distance code, and weight of the package. The constructor determines the six-digit delivery number and delivery fee. Also include a method that displays every Delivery object field. Save the …

Member Avatar for dononelson
0
113
Member Avatar for kenjiro310

[CODE][/CODE] I am trying create a Java program which draws a bar graph based on the input from the command line. Problem i am running into is that I cannot get the values of the Args[] starrting at index 2 to provide values unless i specify the numbers. ANy thoughts …

0
55
Member Avatar for Taimoor Rana

Hello guys, Im tring to make a stopwatch display in JTextField but so far i'am unable too :-(. The stopWatch itself is working perfectly but only in the system output window... I want the time to be displayed in the textfield(or Label) which is within a JFrame. I'll appreciate any …

Member Avatar for Taimoor Rana
0
846
Member Avatar for chchew90

[code]import javax.swing.*; import java.awt.*; import java.awt.event.*; class CelsiusTemperature extends JFrame implements ActionListener{ private double readingInCelsius; private JButton button; private JTextField field; private JTextArea area; private JLabel label; public CelsiusTemperature(){ setSize(500,200); setLocation(250,150); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); label = new JLabel("Celsius"); field = new JTextField(20); button = new JButton("Convert"); area = new JTextArea(10,20); Container container; …

Member Avatar for Javam
0
110
Member Avatar for heryirawan1

I have a program,but there is an error, please help me, thanks program to include six string data (name of city), then do the sorting of the six cities data and print data before and after sorting. but in terms of input data strings, there is an error, please help, …

Member Avatar for heryirawan1
0
228
Member Avatar for ajayb

[CODE]/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * VideoStreamingform.java * * Created on 29 Mar, 2011, 7:01:42 PM */ package audivideotransmit; import javax.media.MediaLocator; import javax.swing.JOptionPane; /** * * @author ajay */ public class VideoStreamingform extends javax.swing.JFrame { …

Member Avatar for mcriscolo
0
120
Member Avatar for Taimoor Rana

Hello, I'm having trouble displaying an output from my code. It suppose to act like a stopwatch where seconds increment and then minutes and then hours but for some reason its not working and I cannot figure out why... :-( hope some some can guide me. Thanks [CODE]/* * To …

Member Avatar for Taimoor Rana
0
1K
Member Avatar for penguino138

I need help position a bunch of things. Mostly the text bar. Here's my code: [CODE] package swingHW2; import java.util.Scanner; import javax.swing.*; import java.awt.*; public class swingHW2 { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub // The Layout FlowLayout lout = …

Member Avatar for penguino138
0
185
Member Avatar for liftthis

I have created 3 files: SmsInbox, SmsGetData and SmsMsg. I don't know if I set this up right. I want Phonenumber, message and time to be stored in the Jlist and when I double click it It will print out the phonenumber, message and time. How do I print it …

Member Avatar for Ezzaral
0
99
Member Avatar for paycity

Hello java programmers, I want to draw some squares on layers using Graphics2D, course. Here is my source code with problems: [CODE]import java.awt.*; import java.util.ArrayList; import java.util.List; import javax.swing.*; public class Draw extends JPanel { private static final long serialVersionUID = 1L; private List<Cube> cubes = new ArrayList<Cube>(); public static …

Member Avatar for paycity
0
1K
Member Avatar for suncica2222

I've made java desktop application,swing gui in netbeans and it works in netbeans but I have 2 problems: 1. I cant export working jar or class files 2. I need to run and build it from cmd line in windows xp I guess that I need to include something in …

Member Avatar for mKorbel
0
3K
Member Avatar for newack

Problem while running program: java.lang.NoSuchMethodError: main Exception in thread "main" My code is: [CODE] import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Plane extends JApplet implements ActionListener { JTextField input; JLabel prompt; JButton yesButton,noButton; int section, firstClass,economyClass; boolean seats[]; boolean questionPosed= false; public void main( String args[] ) { prompt …

Member Avatar for newack
0
214
Member Avatar for cyberbemon

hey guys i came across a tutorial online that shows how to make a java media player using JMF..the problem is when i run the program and open the file i get the following error..i googled this and found no help can anyone please tell me whats wrong ? T_T …

Member Avatar for cyberbemon
0
950
Member Avatar for cretaros

i have tried adding scrollpanes to the Textare but to no avail it cant Appear. i have initialised some text and added it ot the Textarea bt it dosent work. Help me solve it lifesavers! [CODE] import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import java.lang.Object.*; import javax.swing.border.*; import java.awt.Toolkit; …

0
59
Member Avatar for Amillia89

Hai!!! I have a class, Search Class...this class suppose to search the data from the MySQL db...on top of the JFrame, should have two JMenu bar button which is call About Us and Help...the problem is, if you run this code, the JMenu Bar doesn't appear on top of the …

Member Avatar for Amillia89
0
87
Member Avatar for hao90

[CODE]import java.awt.*; import java.awt.event.*; import javax.swing.*; public class SwingAnimation{ Thread th; ImageIcon images; JFrame frame; JLabel lbl; int i = 0; int j; public static void main(String[] args){ SwingAnimation sa = new SwingAnimation(); } public SwingAnimation(){ frame = new JFrame("Animation Frame"); th = new Thread(); lbl = new JLabel(); Panel …

Member Avatar for JamesCherrill
0
120
Member Avatar for Enzo85

Hello everyone, I am trying to read a .rtf file, does this have to be done using the RTFeditorKit? Can a .rtf file be read line by line like a normal .txt file, as I was planning to read it line by line (as a string) to remove punctuation first …

0
114
Member Avatar for RagingRiver

I am having a problem with left alignment after adding a second JPanel. Both JPanels are using the BoxLayout with the first set to Y_AXIS and the second set to X_AXIS. If you comment out the add(twoPanel) it results in the desired left alignment. I don't understand why the alignment …

Member Avatar for Ezzaral
0
414
Member Avatar for stupid guy

hi all, m new to this site and m newbee to this java thing..i have a project dnloaded from somewhere ..and now i have some problem with updating the database ..following is the [CODE] cnt=cnt+Integer.parseInt(dis.getText()); System.out.println(cnt); cnt=cnt+ Integer.parseInt(ent.getText()); System.out.println (cnt); String str="update bikeinfo set stock =" + cnt + " …

Member Avatar for Ezzaral
0
131

The End.