3,978 Topics

Member Avatar for
Member Avatar for zlloyd1

Hi all, I am trying to learn java here, and having some difficulties with a very simple program that I am working on in an attempt to get a feel for what the language can do. This is my code so far: import java.util.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; …

Member Avatar for JamesCherrill
0
929
Member Avatar for ruthvik.vijaykumar

I am creating this Word Processor...for my college project...an i hav this bugging problem, i have this text area which has a popup menu,this popup menu has a listener(below)..now comming to the point when i right click the TextArea a grau colored popup come up(all the menu items hidden) only …

Member Avatar for stultuske
0
143
Member Avatar for laian.alsabbagh

Hello, I have this java code which draws to me 100 nodes(with the sink node)(like the figure) that are connected by links, at the end I will get a tree , now I need to redraw the tree in(shortest path tree using prim algorithm )I have the nods in ( …

Member Avatar for laian.alsabbagh
0
420
Member Avatar for ocw91

I having a serious problem here. This is the code i wrote and i have yet run it because too many errors. I tried minimize the errors. Anyone can help me? As for now even the simple looping also shows error. If you found any other mistake, feel free to …

Member Avatar for stultuske
-1
200
Member Avatar for harinath_2007

Hi folks. I encountered a problem. My application works perfectly if i run it from netbeans. Even it works fine when i build my project and run the jar file from the netbeans(dist) folder. But when i copy the jar file to another place(or another drive) , the jar file …

Member Avatar for stultuske
0
353
Member Avatar for nickecarlo

I have this program where when I click start, it starts painting rectangles one on top of the other by storing each rectangle created by paintComponent in an array and then displaying them on the screen. When I click stop, the animation stops. This is all fine and dandy but …

Member Avatar for JamesCherrill
0
2K
Member Avatar for Red_Rain

Hey everyone, I am attempting to add an array of JTextFields to one of my JPanels and for some reason i keep getting errors and the program crashes when i run it. I know i am prob making some noob mistake but this a project for my first Java class …

Member Avatar for mKorbel
0
666
Member Avatar for cookiejarvus

So the mission here is to have all the user input data to display to the display panel. I was able to achieve this, however instead of the info display after I click the display button the info will display after clicking on any of the radio button options. Im …

Member Avatar for stultuske
0
199
Member Avatar for viona.diminarthi

hei, please help me. I have a project sales .. in the form of sales transactions I would add an update on caret functions texfield subtotal. caretupdate function I use to buy goods at more than one then it will be totaled automatically which will go on with new texfield …

Member Avatar for stultuske
0
374
Member Avatar for caierhui

import java.awt.event.ActionListener; import javax.swing.JFrame; //This Java Program determines the weighted average //of four test scores. //import statements for the needed packages public class Assign1 extends JFrame { //declare JLabel variables as reference to label components //declare JTextField variables as reference to input/output text boxes //declare JButton variables as reference to …

Member Avatar for love1969
0
208
Member Avatar for wannafzan

This is my assignment. I've done it 36 hours straight and I can't think properly so my program looks like kindergarden kid's program. Basically, we have to do a GUI for Pizza ordering. Everything works except for the amount. The output for amount is "0.00". I have to send it …

Member Avatar for wannafzan
0
2K
Member Avatar for javaprog200

Hello, I have a class (Buttons.java) which inherits from JButton and implements the ActionListener interface. The second file (ButtonsTest.java) creates a GridLayout of Buttons and adds them to the applet. The issue I am having is when I click on any of these buttons, the event is not registered. I …

Member Avatar for JamesCherrill
0
268
Member Avatar for Zubenna

![GUI](/attachments/large/4/GUI.jpg "GUI") ![GUI](/attachments/large/4/GUI.jpg "GUI") My name is Nnamdi. I am a new member in this forum. I am learning Java programming and how to develop Java GUI application. In my learning process, I have encountered the challenge stated below. My question: I am writing an application to properly align the …

Member Avatar for Zubenna
0
877
Member Avatar for rafaelzm2000

Hello I need some help completing a quiz program the program simulates a Java quiz I have completed most of the program but there are three issues that i am unable to overcome I tried some of the solutions that i found on daniweb and on google but they didnt …

0
70
Member Avatar for utchia

hi i have been working on my project to create a store and i have to add items and sell items, and once i add items i store them into a textfile separated by commas, and i made the add item button work perfectly but i am having trouble with …

Member Avatar for Majestics
0
580
Member Avatar for Neversleepin

Hi everyone, i want to set input verifier for a jspinner when the user click a value and if the value is out of range (0 to 10) it must display a message like "Please enter a value between 0 to 10" and it must validate until the correct value …

0
163
Member Avatar for Stuugie

Hi all, This is going to be difficult for me to describe but I'm going to give it a go! I have tables called tblCPI, tblCPI_Staging, & tblVSeriesList. Please see the diagram. ![Diagram](/attachments/large/3/Diagram.JPG "Diagram") Right now I am using SSIS 2008 to get data from Statistics Canada and load the …

Member Avatar for Stuugie
0
233
Member Avatar for arcticman452

My program compiles but when I fun it I cannot get the city from the JComboBox to show in my JOptionPane. It shows up as "null" and when I click the clear button, nothing happens. I'm not sure how to fix these two problems. Here is my code: import java.io.*; …

Member Avatar for radhakrishna.p
0
162
Member Avatar for nickcolb

So I'm working on a small calculator applet and whenever a button is pressed (generating an action event) i get this: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException. Something about a missing source? The variable m is an instance of my myFunctions class which houses all the necessary formulas. I believe the …

Member Avatar for radhakrishna.p
0
225
Member Avatar for arcticman452

I have the main part of my code done but I don'T know if I should use an action listener or an event listener for my JComboBox. I have 4 JComboBoxes and only need to retrieve the info from my vehicleBox and fuelBox at this point. I need to take …

Member Avatar for jalpesh_007
0
203
Member Avatar for arcticman452

I cannot get this to show up when I run it and I can't figure out whats wrong. import java.applet.*; import java.awt.*; import java.awt.event.*; import java.text.*; import javax.swing.*; public class TravelCostEstimator extends Frame implements ActionListener,ItemListener { //This part defines how the program will look Panel partOnePanel = new Panel(); Label …

Member Avatar for arcticman452
0
211
Member Avatar for crownedzero

I'm just curious about the use of frames/panels etc. What's are your general practices and why? Single main JFrame with multiple internal then toggling visibility of panels within? Just starting with swing and rather curious how other people implement them.

Member Avatar for jalpesh_007
0
138
Member Avatar for howardcartter

import javax.vecmath.*; import com.sun.j3d.utils.universe.*; import javax.media.j3d.*; import com.sun.j3d.utils.behaviors.vp.*; import javax.swing.JFrame; import com.sun.j3d.loaders.*; import com.sun.j3d.loaders.objectfile.*; /** * An example for constructing an object (tetrahedron) with triangles * where normal vectors are interpolated. * * @author Frank Klawonn * Last change 05.07.2005 * @see GeomArrayExample */ public class Isocahedran extends JFrame { …

0
99
Member Avatar for marek2121

I have a problem with serializing an Arraylist. This is my method to serialize Arraylist: public void serializeObj(){ ArrayList<Actor> novylist = new ArrayList<Actor>(); novylist.addAll(components); try { FileOutputStream fileOut = new FileOutputStream("zeditoru.ser"); ObjectOutputStream out = new ObjectOutputStream(fileOut); out.writeObject(novylist); out.close(); fileOut.close(); }catch(IOException i) { i.printStackTrace(); } } components is Arraylist with theese …

Member Avatar for subramanya.vl
0
767
Member Avatar for AngelOfRock

Hi guys, I got a problem with my Programm after adding a new Class in my Tic_Tac_Toe version...I tryed to use a method of the clas KI_Test1 ( which is a very simple "AI"). The class before without static works. After changing everythin in static, because my main method is …

Member Avatar for AngelOfRock
0
535
Member Avatar for tabmanmatt

Hi everybody. Sorry for the newbie post. I have an assignment I was just looking for some help with. I need to create a dice game that generates a random two dice throw and then gives you three tries to guess the number. I seem to be a bit stuck. …

Member Avatar for JamesCherrill
0
278
Member Avatar for M-rhodes

Hi, I'am creating a single JFrame UI, that uses multiple JPanels (implemented through JTabbedPane). The problem I'am having is aligning the objects within each JPanel. In the first JPanel all of the objects are centrally aligned. I'am unsure of what to do to solve the problem. I have read the …

Member Avatar for JamesCherrill
0
223
Member Avatar for Helen Toma

this program is 2 classes and it has 2 JLabels, 2 JTextFileds, and 2 JButtons... it convert temperatures from Fahrenheit to Celsius and from Celsius to Fahrenheit.. Class 1: [code] // Author: Helen Toma import java.awt.BorderLayout; import java.awt.FlowLayout; import java.awt.GridLayout; import javax.swing.JTextField; import javax.swing.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; …

Member Avatar for JamesCherrill
0
6K
Member Avatar for Neversleepin

i'm trying to modify a java code. I have a jSpinner where the user have to choose a number like minimum 0 and after this step the user can continue by clicking the OK button and continue his steps... So here what i want is when the user didn't enter …

Member Avatar for Neversleepin
0
2K
Member Avatar for Neversleepin

Hi, i try to handle a Neagtive number exception in my code. i tried this but it shows "illegal start of type" why please? Here is my code: public class JPanelTemporal extends javax.swing.JPanel { public JPanelTemporal() { initComponents(); } public void setDuration(int duration){ this.jSpinnerDuration.setValue(duration); } public Time getTime(){ Time time …

Member Avatar for Neversleepin
0
15K
Member Avatar for Violet_82

Hi there I am reading some java tutorial and a have a question about these 2 classes java.util.Scanner; javax.swing.JOptionPane; In the tutorial I am looking at the 2 classes are used in separate programs to get the input from a user With the first class http://www.homeandlearn.co.uk/java/user_input.html after importing the class …

Member Avatar for Violet_82
0
2K
Member Avatar for Zatara7

So this is going to be the last project for my java class. Any input is appreciated and I'm generally posting it here because someone else might benefit from it. It is not done yet but when it is I'm going to post the full code. I made a video …

0
396
Member Avatar for hwoarang69

how to fix animation flickering import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Image; import javax.swing.JApplet; public class main extends JApplet implements Runnable { //player information variable int x = 10; int y = 50; int width = 30; int height = 30; int dx = 1; //########################################################################################################### /*** init method ***/ public …

Member Avatar for zeroliken
0
148
Member Avatar for hwoarang69

i am creating a rect in paint method. and i am trying to move it to its right by 1 px in loop. but the problem is its not going inside the run method. any idea why? import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Image; import javax.swing.JApplet; public class main extends JApplet …

Member Avatar for zeroliken
0
168
Member Avatar for smellysocks

Hello, I have an assignment for class where I have to write an apple that uses a trip time calculator. I have the following codes but cannot get the applet to run properly. Help is appreciated. Thanks. import javax.swing.*; import java.awt.*; import java.awt.event.*; public class TripComputerApplication extends JFrame implements ActionListener …

Member Avatar for zeroliken
0
1K
Member Avatar for akosivivas

Pls.. Someone help me on how to display in JLabel the product with two decimal places after I click a button.. pls. help I am new in making a swing program

Member Avatar for radhakrishna.p
0
190
Member Avatar for cezar84

Hi Guys, I'm new to Java and hoping someone can help me with this code. I started to work on this exercise to create a calculator app, and Im really stuck on two things: 1. NumberFormatExeption - NetBeans IDE keep show me this error: }catch(NumberFormatExeption e){ required: Throwable found: NumberFormatExeption …

Member Avatar for radhakrishna.p
0
146
Member Avatar for Linsley

i have to create a calculator (i'm a 12 year old) for the science fair. on textwrangler when i try to compile it :Expected end of line, etc. but found identifier. here is my code: import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.util.*; public class JavaCalculator extends JFrame { private …

Member Avatar for radhakrishna.p
0
404
Member Avatar for jprog1000

Hello Members, I have a program (from Deitel Java Solution Manual) which bounces a ball using a Java thread inside a JPanel(which is inside a JFrame). When I made a custom class for the ball, the program is not painting anything on the JPanel.I would appreciate any help. Following are …

Member Avatar for javaprog200
0
350
Member Avatar for junweixiong

Hello, I am making a authentication software, and this is the code for the Username panel. import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.Scanner; import java.util.ArrayList; import java.io.*; public class Username { private static String username; private static char[] actualUsername; public Username () { final JFrame frame = new JFrame("Username"); …

Member Avatar for junweixiong
0
4K
Member Avatar for Benderx

Hi everyone, I was writing a program to show visually some vectors I was implementing with Java but I ran into an issue. My program has 3 classes, a driver, a Vector class and a VectorDisplay. The driver and vector class are self explanatory, but here is the code. Driver: …

Member Avatar for JamesCherrill
0
360
Member Avatar for javaprog200

Hello, I am writing a Java applet which uses the JExcel API to write to an Excel file. I have pasted the run-time error that I get below. After some research about the Exception, I added a policy entry using the policytool command for any Java program by selecting CodeBase<ALL>. …

Member Avatar for javaprog200
0
628
Member Avatar for LdaXy_1

how do i check if a menu item in my JMenuBar has been clicked? for instance, i have a JMenu with an item called exit, which i need to make close the form. how do i do this? import javax.swing.*; public class selector_form extends JFrame { /** * */ private …

Member Avatar for <M/>
0
485
Member Avatar for mukiibi

This code can help you to find the square root of three numbers accepting the inputs from the user and displaying the results in a Joption pane. let me hope it will help import javax.swing.JOptionPane; import java.text.DecimalFormat; public class Squareroot { public static void main(String[] args) { String stringNum1,stringNum2,stringNum3; double …

0
99
Member Avatar for cyanide911

I've been learning Java by myself through many different online and offline resources. I just finished some basic practice and theoretical knowledge of Swing. Now, to become good at it I need some practice problems which would test my Swing skills, including GUI Building, listeners etc. But I can't figure …

Member Avatar for NormR1
0
171
Member Avatar for salan

Sorry everyone i'm new to java and i have an assingment which i have hand over soon i just want get an idea how to calculate car insurance premium based on the age,Licence and Engine size this is my first time come in to this site even so.. if you …

Member Avatar for NormR1
0
219
Member Avatar for marek2121

I am trying to create Menu to may 2D game in Java. But the game is not responding to pressed keyes. Menu is working, but when I choose new game in menu, game starts but it does not react to pressed keyes. But, when I remove menu, game is responding …

Member Avatar for NormR1
0
822
Member Avatar for littlebit12

Hey can you guys help with this? Basically with all that is left? Thank you! import javax.swing.*; //for JFrame import java.awt.*; //for Graphics and Container import java.util.Random; import javax.swing.JOptionPane; // other import statements here public class RandomGraphics { // constants are used to draw the grid, and for you to …

Member Avatar for NormR1
0
137
Member Avatar for harinath_2007

Hi folks. I am in search of automated swing builders (stylish jframe builders). Basically like IDE's. Yeah I am well familiar and bored of this netbeans, eclispse, etc. Can anyone suggest me some tools that will create some cool and **stylish** jframes or swings by just drag and drop.. I …

Member Avatar for stultuske
0
299
Member Avatar for Viped

Hi, I was creating clone of breakout and got the game working correctly. But after setting up menu my keyboard doesnt respond anymore. But if I launch game directly without Menu class keys are working perfectly. Where the problem might be? Here is the full source code. VBreakOut.java package net.viped; …

Member Avatar for NormR1
0
409

The End.