3,978 Topics

Member Avatar for
Member Avatar for mxwarning

Hello Again, I am in need of some help getting my GUI to display the inventory values. The code runs and compiles successfully, but it does not display anything. I am new to this and could use some help. Thanks! package inventory; import java.text.DecimalFormat; import java.util.Arrays; import javax.swing.*; import java.awt.*; …

Member Avatar for stultuske
0
3K
Member Avatar for Wendy_2

Beginner programmer here and I am lost on a project for a class. I have to develop a Java application that calculates the monthly paychecks for a numbe of different types of employees. The employee types are created in a subclass array based on parent base class Employee. The initial …

Member Avatar for Wendy_2
0
276
Member Avatar for hedrun

Hi, Everyone! So, i need a simple swing binary tree code, if anyone of you guys have it, please share to me =( Thanks, a big hug.

Member Avatar for JamesCherrill
0
178
Member Avatar for Search_not

How do I add HTML5 functionality to my browser? Its still a work in progress, so ignore the event handlers and buttons that seem pointless... package browser; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; public class ReadPage extends JFrame { private JTextField address; private JEditorPane display; private JButton refresh; …

Member Avatar for Slavi
0
155
Member Avatar for sciprog22

Hello, Thank you for your time! I have an applet where I have two blocks moving: When the program starts: a)The first block is constantly moving with a time delay of 100 ms about the horizontal direction at the top end of the applet (x starts at 0 and is …

Member Avatar for sciprog22
0
162
Member Avatar for sciprog22

Hello, Thank you for reading my message! I have an applet, where I make two instances of the custom JPanel objects and I add them into two JFrames and display them. Both of these panels have a 10 x 10 grid of buttons and an event handler is added on …

Member Avatar for sciprog22
0
152
Member Avatar for NightOwl19

Heya guys, i have been trying to make this very famous ball game using java swing. although the primary code ihave used is from this link [[Click Here](http://www.edu4java.com/en/game/game6.html)](null)but been trying to modify it to make it look less complex..But everytime i run it it gives me following error: Exception in …

Member Avatar for NightOwl19
0
530
Member Avatar for vishalonne

Hello I am trying to bring label and textfield closer to each other but not getting the right way how to do it, my code is giving output with a big gap between label and textfield & label and passwordfield. I want some help on how can I remove this …

0
91
Member Avatar for juhitha

when i tried executing my java project i got the following errors Exception in thread "AWT-EventQueue-0" java.lang.UnsupportedOperationException: TRANSLUCENT translucency is not supported. import java.awt.Color; import java.awt.Dimension; import java.awt.GridLayout; import java.awt.Window; import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.ArrayList; import javax.swing.AbstractAction; import javax.swing.JComponent; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; …

Member Avatar for JamesCherrill
0
530
Member Avatar for kayleigh0411

I am trying to make a program that will tell how much a ticket costs and what the admission status is for a movie based on the age of the person. For ages 1-4 and 55 and up, it is $0.00 and "Free". For ages 5-12 it is $4.25 and …

Member Avatar for stultuske
0
163
Member Avatar for haider885

I don't know what I am missing. Help me. import javax.swing.*; import java.util.Scanner; public class Operator { public static void main(String args[]) { String num1,num2,op; int ans; Scanner cin = new Scanner(System.in); num1 = JOptionPane.showInputDialog("Enter First Number"); op = JOptionPane.showInputDialog("Enter Operator"); num2 = JOptionPane.showInputDialog("Enter Second Number"); char c = (char) …

Member Avatar for zolymo
0
159
Member Avatar for 2384443

Hi everyone, i need your help.. I want to draw a circle,square and rectangle on Jframe on a click of a button.. This program was asked in my test paper, i couldn't get it right though bt i wanna know what my mistake is.. Plz help me.. import javax.swing.*; import …

Member Avatar for JamesCherrill
0
346
Member Avatar for moaz.amin.37

i write a code in java of GUI calculator. i handle its addition event only but it is not working i don't know why its code is here import java.awt.*; import javax.swing.*; import java.awt.event.*; class Calculator extends JFrame implements ActionListener{ JTextField jtext; JPanel p; JLabel lab; JButton b1,b2,b3,b4,b5,b6,b7,b8,b9,b0,bPlus,bMinus,bMul,bPoint,bClear,bEqual; public Calculator(){ …

Member Avatar for JamesCherrill
0
2K
Member Avatar for kayleigh0411

I need to make this program GradeCalculator.java, and I can't figure out what is wrong with it. I'm really struggling, could someone please help! Thanks!! In the GradeCalculator.java program the user clicks the Enter button. The first input is a JOptionPane that asks the user, “Number of score to be …

Member Avatar for stultuske
0
187
Member Avatar for javaCONFUSEDDD

// Given that no person has ever lived longer than 123 years (and assuming that no one ever will), write a Java application that will determine if it is possible that anyone who is alive today is, has ever been, or will ever be alive in a year that is …

Member Avatar for TylerD75
0
728
Member Avatar for temp_1

Hello, I'm using Netbeans with JDK 7. I'm developing a swing desktop application with embedded derby database. I'm using the following code. Statement stmt; try { Class.forName("org.apache.derby.jdbc.EmbeddedDriver"); Connection conn = DriverManager.getConnection("jdbc:derby://localhost:1527/HelloWorld", "userid", "password"); stmt = conn.createStatement(); String sql = "INSERT INTO TABLEEMP " + "VALUES (" + Integer.parseInt(jTextField1.getText()) + ", …

Member Avatar for ~s.o.s~
0
201
Member Avatar for Benny_1

I've been working on a project I found on the Java Projects for learners thread. I've created a pokedex simulator that keeps track of pokemon. So far you can view a list of recorded pokemon, get more detailed info, add a pokemon, and it's all saved to files. However it's …

Member Avatar for Benny_1
0
306
Member Avatar for gajen007

Gentlemen, I have a problem in entering a "DATE" in to MySQL table via a Java SWING interface. I used 'jdatepicker' to select a date & I use XAMPP server for MySQL database. Earlier I converted the selected date in to String values & feed as VARCHAR in mysql table. …

0
107
Member Avatar for LilPrincess017

Hi thanks for reading this post. Hope you could help me. I have this question i can't figure out. Thanks in advanced for helping :) I kept receiving message dialog box containing "The document has no pages." whenever i click the PrintAllbutton. I used jasperreports, in which i'm not familiar …

Member Avatar for Tarek_2
0
3K
Member Avatar for NightOwl19

Heya guys, i'm a newbie at java gui and trying to make a calculator using swing. Although i have made the calculator previously but this time i'm trying to add a menu bar also. The problem with the code is whenever i try to add menu bar without making the …

Member Avatar for NightOwl19
0
150
Member Avatar for Samyx

Hi Everyone, I am playing around with some Java following some tutorial online and ran into a problem that I cant seem to figure out. In the code below, inside of the groupButton method I get the error 'JRadioButton1,JRadioButton2 and JRadioButton3 cannot be resolved to a variable'. Can you please …

Member Avatar for cgeier
0
1K
Member Avatar for kayleigh0411

I have to create a program that will calculate the the average miles per tank and the cost to fill tank of a car. The inputs are tank capacity, miles per gallon, and price per gallon, the outputs are average miles per tank and cost to fill tank. I have …

Member Avatar for Tarek_2
0
207
Member Avatar for kayleigh0411

There are no errors or anything in my code, and the program runs and works. However, when I only enter a value in one of the text fields to test the error message, it enters "0" in all of the text fields below it. How can I get it so …

Member Avatar for stultuske
0
281
Member Avatar for Stefce

Hello i have a little problem over here im trying to make a mouse listener and on mouse click the ball to come to the mouse pointer... i have maked a small "game" which is not bunch of confusing code... i have maked the ball to be controlled by the …

Member Avatar for Stefce
0
2K
Member Avatar for kayleigh0411

There are no errors when I compile the program, but when I run it and use the "Enter" or "Clear" buttons, they do not work. ----jGRASP exec: java IncomeTax Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at IncomeTax.enterJButtonActionPerformed(IncomeTax.java:182) at IncomeTax$1.actionPerformed(IncomeTax.java:125) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2346) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252) at java.awt.Component.processMouseEvent(Component.java:6525) …

Member Avatar for stultuske
0
2K
Member Avatar for GingerDontCare

Hello Daniweb, So, I am currently working on a simple download time estimator program using JOptionPane and some loops. I have some beginning code and wanted to check how it is working, only it seems I messed up something and am stuck in my loop when I run it. I …

Member Avatar for GingerDontCare
0
1K
Member Avatar for Benny_1

Hi. I am making a really simple program to refresh my knowledge in java (which is obviously needed). When I click the screen, I want a bullet to appear in the center and move towards the point I clicked. Right now, when I click on the left half the bullet …

Member Avatar for JamesCherrill
0
200
Member Avatar for newprogidk

Hello great programmers at this website. Hopefully your day has been good so far. I was wondering if you could help me with some Java errors related to the header of my program that I am doing for an assignment. Thank you millions for your help. Here is the code: …

Member Avatar for stultuske
0
173
Member Avatar for V3N0M

Hi guys I am trying to build a simple calculator but I cant get the answer to show in the output in Jtextfield here is the test // Testing Calculator import javax.swing.JFrame; public class CalculatorTest { // Main method public static void main( String[] args ) { Calculator calculator = …

Member Avatar for JamesCherrill
0
201
Member Avatar for smartguy360

I tried dreamincode but the mods there are pretty mean so i have come here to humbly beg for help. First off let me start by saying I'm a new programmer and I am frustrated and cofused by the class i'm in prg 420. I need to pass this assignemn …

Member Avatar for JamesCherrill
0
918
Member Avatar for johnson_2

First of all I apologize as my explainations is going to be lengthy I have a server that listens to incoming clients and they are connected to localhost. **Assuming that I only have 2 clients and assuming they only enter a text ONCE** so each time the client is connected, …

Member Avatar for raj.mscking
0
314
Member Avatar for gajen007

I faced a NullPointerException for below code. What is the cause? import javax.swing.*; import java.awt.*; import java.awt.event.*; import net.sourceforge.jdatepicker.*; import net.sourceforge.jdatepicker.graphics.*; import net.sourceforge.jdatepicker.impl.*; import net.sourceforge.jdatepicker.util.*; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class selectDate extends JFrame implements ActionListener { JLabel CheckDate; JButton check; public UtilDateModel model; public JDatePanelImpl …

Member Avatar for raj.mscking
0
7K
Member Avatar for wanttocode

i'm unable to get my entered values i initialized array to enter student record and also write functions to get this done but when i call functions i can't get any value and all output is "null" package javaapplication10; import javax.swing.JOptionPane; public class JavaApplication10 { public int x=10; public int …

Member Avatar for Ralphael
0
113
Member Avatar for Pravinrasal

Following is my program i need to add scroll to jframe and I have paint method in it package other; import java.awt.BasicStroke; import java.awt.Color; import java.awt.Container; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.ScrollPane; import java.awt.Stroke; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.geom.Line2D; import javax.swing.*; public class MainDrawCycle extends JPanel implements ActionListener { …

Member Avatar for Pramodkumar_1
0
7K
Member Avatar for henryz_box

I have a Jframe that contains a JPanel which has a label that I use as a background image and a second JPanel that I want to add my controls into. I am attempting to add and position labels dynamically. I can add the labels but they all appear at …

Member Avatar for JamesCherrill
0
491
Member Avatar for toring

Hi, I need some help please i could not show the balls,when my pacman is moving,i want my pacman will through balls when it's moving.but i could not show his balls,can you please help me what is wrong or missing in my code. I appreciate someone can help me import …

Member Avatar for JamesCherrill
0
232
Member Avatar for sumaya_ak

import javax.swing.JFrame; import java.awt.BorderLayout; import java.awt.GridLayout; import java.awt.FlowLayout; import javax.swing.JPanel; import javax.swing.JLabel; import javax.swing.JButton; import javax.swing.JTextField; import javax.swing.JTextArea; import java.awt.event.*; import java.awt.Color; import java.awt.Font; import javax.swing.border.Border; import javax.swing.border.TitledBorder; import javax.swing.JToolTip; import javax.swing.JTextArea; / public class Swing extends JFrame implements ActionListener import javax.swing.JFrame; import java.awt.BorderLayout; import java.awt.GridLayout; import java.awt.FlowLayout; import javax.swing.JPanel; …

Member Avatar for stultuske
0
173
Member Avatar for Alex_27

import java.awt.BorderLayout; import java.awt.Color; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import javax.swing.*; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JPanel; public class PanelCenter implements KeyListener,MouseListener import java.awt.BorderLayout; import java.awt.Color; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import javax.swing.*; import javax.swing.JButton; import …

Member Avatar for Taywin
0
1K
Member Avatar for Desmond_1

I noticed a few things about my results from my codes. If I don't key in anything,no matter what I press(the ok,cancel or the x button) It will print out Please enter an integer value cannot be 0 or negative and contiune to prompt me until the I key in …

Member Avatar for mKorbel
0
668
Member Avatar for moaz.amin.37

hello to all i have problem about button events the problem is that if i handle an event of button and show again a window(result of event) that also has buttons then how to handle events of buttons of second window please help me

Member Avatar for mKorbel
0
168
Member Avatar for liltrig3

Hi Everyone. I Really Need Urgent Help To Create A Paint Application In Java Using Applets Or The Swing. Its Really Urgent. I Have Been Trying To Code This For Like Week Now And I Am Just Left With Five Days To Submit It. Thsi Application Should Be Able To …

Member Avatar for stultuske
0
4K
Member Avatar for Desmond_1

import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import javax.swing.JFrame; import javax.swing.SwingUtilities; import javax.swing.Timer; @SuppressWarnings("serial") public class OnClickLesson extends JFrame { private int value = 0, clicked = 0, countdown = 1; private Timer timer = new Timer(1000, null); public OnClickLesson() { timer = new Timer(1000, new countDownTimer()); addMouseListener(new MouseAdapter() …

Member Avatar for Desmond_1
0
257
Member Avatar for Slavi

Apparently JavaFX is getting really into the game now as far as I see and I think its time I start getting to know it .. Just read a couple of articles and a few questions came up in my mind: - Do I need to use IDE (eclipse) for …

Member Avatar for Doogledude123
0
290
Member Avatar for 2384443

well guys, i wanted to try somethng fun in java, so i made a simple form type navigation program.. i can compile this file, bt i cant run it..NOTE: i have no issues in my java software.. import javax.swing.*; import java.awt.event.*; import java.awt.*; import java.util.regex.*; public class Nav2 extends JFrame …

Member Avatar for 2384443
0
247
Member Avatar for johnson_2

1. I created three JLabels(one,two,three) and add a mouselistener to it. 2. For every even turns, the program will allow me to click any of the JLabels **once** and print out the JLabel I have clicked. My program is throwing me the following errors Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java …

Member Avatar for johnson_2
0
286
Member Avatar for chdboy

import java.awt.Frame; import java.awt.SplashScreen; import javax.swing.JOptionPane; public class NewFrame extends Frame { public NewFrame() { // TODO Auto-generated constructor stub SplashScreen splash = new SplashScreen(1000); System.out.println("This is working"); } /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub //SplashScreen splash = new SplashScreen(2000); …

Member Avatar for JamesCherrill
0
306
Member Avatar for Violet_82

Hi guys, I run into a problem. I am trying to write a small program. There should be 4 radio buttons and each of them controls the colour of the Content Pane. The problem I have is with the anonymous inner class (I hear JamesCherrill muttering "why do you bother?", …

Member Avatar for JamesCherrill
0
298
Member Avatar for asaidi

Hi i m using my host to save mysql database.. when i fill the fields the data is saved ..but i m keeping getting this error ..and really the data input is saved i dont understand why.. the error i get thank you in advance com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The …

Member Avatar for asaidi
0
301
Member Avatar for rowen_1

Requirements 1. the user clicks the button(Go to animation page) at page one 2. the user will be directed to page two whereby an animation is played for 5 seconds 3. after 5 seconds, the user will be directed to page three. I am trying to delay a page for …

Member Avatar for JamesCherrill
0
186
Member Avatar for Steven_9

I am currently taking java and learning how to create GUI. I am trying to create a GUI whereby 1) Upon executing the application,the user will need to key in his username and password. 2) the user will be brought to second page which displays "Welcome to Page Two!" if …

Member Avatar for Steven_9
0
2K

The End.