3,978 Topics
![]() | |
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.*; … | |
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 … | |
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. | |
![]() | 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; … |
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 … | |
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 … | |
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 … | |
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 … | |
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; … | |
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 … | |
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) … | |
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 … | |
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(){ … | |
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 … | |
// 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 … | |
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()) + ", … | |
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 … | |
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. … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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) … | |
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 … | |
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 … | |
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: … | |
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 = … | |
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 … | |
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, … | |
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 … | |
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 … ![]() | |
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 { … | |
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 … | |
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 … | |
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; … | |
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 … | |
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 … | |
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 | |
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 … | |
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() … | |
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 … | |
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 … | |
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 … | |
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); … | |
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?", … | |
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 … | |
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 … | |
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 … |
The End.