3,978 Topics
![]() | |
This is an assignment I am working on for uni and I have done quite alot by myself and with some hints along the way from others who know Java better than I do. So I am working on a GUI Traffic Simulator (creating the GUI and drawing it is … | |
![]() | Ok so this code works great with an if else statement but i dont why when i change the showMenu to a switch statement you cannot see my print out statement as a menu!? Iv tried different ways of writing the print outs and they havent worked at all. Also … ![]() |
I hope this hasn't been beaten to death...I looked through the forums and didn't find what I needed. I have a form where an input (textbox) Change event populates several other inputs within the form via ajax...everything works famously when I comment out the Form::open('edit_product'), Form::button('submit', 'Save Product'),and Form::close() in … | |
[CODE] import java.io.*; import java.util.*; import javax.swing.JOptionPane; public class A15 { public static void main(String[] args) { if(args.length != 1) { JOptionPane.showMessageDialog(null, "Error: Enter one command line argument."); } else { try { String[] array = LeeJungBum15.readFileReturnWords(args[0]); // read file sortAndPrintArray(array, args[0]); // sort alphabetically and print the arrays } … | |
Hi there, Consider the following code, this is a little 'snipet' from one of my classes: [CODE] private void jMenu1ActionPerformed(java.awt.event.ActionEvent evt) { NewContact n = new NewContact(); } [/CODE] The method is expected to open a new Frame, where the class of the new Frame is called "NewContact". I've recently … | |
Firstly, Hello everyone! Ok so I am going through exercises in my Java book and am having a problem with this one question. Basically, it wants a user to input a telephone number as letters capital or lower case, spaces or not... eg. Get-Loan which would be 438-5626. So the … | |
I have several classes(all in swing). How can I put all the classes that I have create into tabbed Pane? I have 4 class: Intro in=new Intro(); Hist his=new Hist(); Product pro=new Product(); Contact con=new Contact(); [CODE]import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTabbedPane; public class MainControl extends JFrame { … | |
Hey Lifesavers! How can i dispose the current frame holding the combobox on item selection to navigate to the next frame. The dispose(); method does not dispose the Main class, when i select supplier item onthe combo list. how can i reolve this; sample code from the sodes is below. … | |
Hi all I have a gantt chart which i draw with JFreeChart. I want to add to this grpah a line that shows the current date. Does any 1 knows how to do it? Here is the code that i've written: [code] /* * To change this template, choose Tools … | |
Im trying to make a breakout game. I cant seem get the score to show up, but I was able to get everything else working. [CODE]import javax.swing.*; import java.awt.*; import java.awt.event.*; public class PongPanel extends JPanel implements ActionListener { private Paddle paddle = new Paddle(); private PongBall ball = new … | |
I don't know why it throws the exception any ideals?? heres my error: the line it tells me is throwing the exception is highlighted in red: run: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4 at lab32analyzingscores.Main.main(Main.java:15) Java Result: 1 BUILD SUCCESSFUL (total time: 11 seconds) [CODE] package lab32analyzingscores; import javax.swing.JOptionPane; /** … | |
hey everyone, i am creating a project from already created code below. this is just one class of it. this class projects 4 or less points on the image. the source for those points is received from wii (gaming consoles) remote that tracks infra-red light so it displays infra-red light … | |
How do I write an event listener that displays an image when I click the upload button? so far i have [CODE] jButton1 = new javax.swing.JButton(); jButton1.setText("Upload"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } });[/CODE] and then [CODE]//the LOAD button for loading the file private void jButton1ActionPerformed(java.awt.event.ActionEvent … | |
i want to disable the NO and CANCEL option , can you guys help me because im only a begineer of JOPTION here is ma code: btw this is my assignment in my 1st year college "compro" my teacher tell us to create a program , and my system is … | |
Hi! I'm making a code right now but I don't know how to continue.....my problem is that I have to make an online shopping list...first, data will be shown to the viewer or buyer...i've done that already. next the buyer should enter the itemID then the number of pieces of … | |
I need to sort a text file that has text, whole integers and float integers. The code I have thus far is able to take the data and perform required calculations. Next I need help with sorting by last name and outputting data in a table. I was successful in … | |
.how would able to show monthly balance .would like to charge a fixed a fee each month .would like to charge withdrawal fee import java.awt.*; import java.awt.event.*; import javax.swing.*; class GuiAccTest extends Frame implements ActionListener { Label lab=new Label(" "); Label lab1=new Label(" "); TextField t[]=new TextField [4]; Label l[]=new … | |
how would i be able to show the end of month balance using pop up window and also would like to charge a fixed a fee each month and withdrawal fee import java.awt.*; import java.awt.event.*; import javax.swing.*; class GuiAccTest extends Frame implements ActionListener { Label lab=new Label(" "); Label lab1=new … | |
will someone help me pls with my case study, i need it very urgent this is my code for shortest remaining time first or the preemptive sjf. i need to know how to make gantt chart. [CODE]import java.applet.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class SRTF extends Applet implements … | |
I would like to be able to divide this java code up into more than one file, so I can reuse the code for other programs, but I'm not sure what I can grab. Right now, I can't make another program using this code, as you see the WHOLE program … | |
I am having problem with calculating the angle using sin. So far, I got the literal of numbers, which is not making sense. I am supposed to match my answers with this: Set up new triangle with coordinates (0.0, 0.0), (3.0, 0.0), (3.0, 4.0) Area: 6.0 Parimeter: 12.0 Length side … | |
There are already 2 checkboxes to change to bold and italic. Now I want to make four radio buttons to change the font of the saying "say it with style!". Below is my code. [CODE]//******************************************************************** // StyleOptionsPanel.java Author: Lewis/Loftus // // Demonstrates the use of check boxes. //******************************************************************** import javax.swing.*; … | |
Hi, I am trying to learn about JQUERY. So , I found some examples and I am trying to apply to my pages. But something goes wrong. Could you help me please ? For example 1.html [CODE] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" … | |
I created a little beginners program, and its about a Telephone network which has an operator and three clients: i made four classes, and it gives me error at planta and cliente In cliente it gives error on public class cliente private operadora Im Planta it gives me error in … | |
Hey, this is my first post, and i'm a complete noob at Java. (i don't exactly know if i did the 'code tags' correctly, so if it didn't work properly, just know that I tried. my basic question is this: I'm trying to make a program that runs fullscreen on … | |
Hi all, I wrote this program for constructing an ID out of someones first name, middle name, last name, and address. I got it to work and run perfectly except for one small thing. There is suppose to be the possibility for the person to not enter a middle name, … | |
[CODE] import java.awt.*; import java.awt.event.*;//for specifying windows events import javax.swing.*; import java.lang.*; public class FrontE implements ActionListener,Runnable { JTextField jav,it,c; Frame f; JButton Submit; int aa,bb,cc,tot; float avg; FrontE() { f=new Frame("Progress Calculator"); JLabel l1=new JLabel("Enter the marks here:"); f.add(l1); Panel p=new Panel(); Panel p1=new Panel(); JLabel java=new JLabel("Java"); jav=new … | |
I ma creating a Project on Java Uaing editor NetBeans 6.0 In this project, i want to put Dynemic image on JLabel which gets the Image Path from Database. It works Properly BUT.... The size of JLabel autometicaly adjust:( If the Image size is 1024x672 then JLabel covers whole Swing … | |
ok, i have a problem with JLayeredPane. I'm about to make a game in full screen mode, so basically I create a JFrame first, and I named it MainMenu.java. In this JFrame, I first display my main menu, where there are 4 main buttons there. When the button is click, … | |
When i run this it does not work like its supposed to. Basically the program is a password verifier that checks what the user enters. It works to check for the 6 characters but it does not work correctly to check for the uppercase, lowercase, or the digit. [CODE]import javax.swing.JOptionPane; … | |
I need to change this program that I made to an applet. I can't seem to get java to paint. Do i need to use a content pane? I tried using a content pane which was commented out. I must be missing something. [CODE] import javax.swing.JApplet; import javax.swing.*; import java.awt.Color; … | |
I am having trouble coming up with formula to print a triangle of numbers in a panel. I can print them to a specified number, of my choosing, but I can't seem to come up with a formula to print them out according to the size of the frame and … | |
Hey Guys I don't get what I need to add Im fairly new in Java. this is my code but it gives me these below the line errors below [code]import javax.swing.*; public class Movies { private String name; private double price; private int year; public Movies { name=""; price=0.0; year=0; … | |
Good morning all. I'm having some difficulty in reading from a sequential file. I think I have my code set up properly, but when ran, it throws an exception which show me the error statement I specified. When I ran a debug, it does seem to be pulling the information … | |
[CODE]/** * @(#)aboutUs.java * * * @author * @version 1.00 2010/10/7 */ import javax.swing.*; import java.awt.*; public class aboutUs extends JFrame{ private desPanel des=new desPanel(); public static void main(String args[]){ aboutUs frame=new aboutUs(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); } public aboutUs() { desPanel.setTitle("About us"); String desc="This Choose Your Flavor is a shop that … | |
![]() | Hey :D I'm currently writing a software where users pick out seatings from auditoriums. The tables will contain seating statuses of auditoriums, which could update quickly. I was thinking of using a thread to repaint the contents, however as the software could be used by many users on the same … |
hey guys, thanks for looking at this. I'm new to java and need help with this one problem. What i need to do is, 3) Write a program that calculates and displays a person’s body mass index (BMI). The BMI is often used to determine whether a person with a … | |
The class Newfile has a red zig zaggy line underneath it, The type Newfile must implement the inherited abstract method ActionListener.actionPerformed(ActionEvent). What does this mean? My code ^_^' : [CODE]import java.awt.FlowLayout; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.JButton; import javax.swing.JMenu; import javax.swing.*; import java.util.*; public class tuna … | |
Hi all, Having issues with my guessing game I made. For once its not a compiling error. For some reason my loop only executes once, and it wont re-execute when the wrong number is entered. Hoping someone can help me. Here is my code: [CODE]import javax.swing.*; public class Guessing Game … | |
Hi - Im making a small and relatively simple game that use's the common feature of the scoreboard to keep track of the user's score. I have declared the main game frame in one class, the actual game on one panel in another and have decided to keep the scoreboard … | |
I really need help(ideas) with a project I want to work on. I want to build a software that will be used for Financial Management in a bank with java. What I need is help with where to start and also pointers to resources that might help me get this … | |
Here i created four buttons. If i clicked second one i should able to draw a line. please tell me what is the mistake.. [code = Java]import java.awt.*; import javax.swing.*; import java.awt.event.*; class Polygon extends JFrame implements ActionListener { JFrame f; public JPanel jp1,jp2,jp3; JButton b1,b2,b3,b4,b5; JTextField txt; int x,y; … | |
This is code for, a smiley have to move on the screen from one place to another. But in this code Smiley create but it is moving. Please tell my? Is there any wrong in my code. import javax.swing.*; import java.awt.*; class CreateSmiley extends JPanel { int x = 0,y … | |
I tried it by using table.addRow statement.plz i need to add on action performed by ADD button.plz can any suggest me. | |
Hi, I have done my ordering class. which contains all the components. My problems is how do I set picture as the background and maximize the picture size? either one of the way 1) i have a class that contains the picture program. How to connect the two program? the … | |
hi, this is my code to display one textarea, textfield and label in the flowlayout. and 2*2 button /** * @(#)Gui.java * * * @author * @version 1.00 2010/10/5 */ import javax.swing.*; import java.awt.*; import java.awt.event.*; public class Gui extends JFrame{ JButton b1=new JButton("one"); JButton b2=new JButton("two"); JButton b3=new JButton("three"); … | |
Hello Members, If possible, kindly let me know why I am not able to see the text in the buttons("Button" and "Button two!") when I run this Java program: [CODE]import java.awt.*; import javax.swing.*; public class Sample extends JFrame { private JButton b1, b2; private final Container container; public Sample() { … | |
[CODE]import java.awt.*; import javax.swing.*; import java.text.NumberFormat; import javax.swing.JFormattedTextField; import java.awt.event.*; import java.text.*; public class Database extends JFrame { private JSplitPane splitPaneV; private JSplitPane splitPaneH; private JPanel panel1; private JPanel panel2; private JPanel panel3; private int X1, X2, X3, X4, X5, Y; private JLabel gradeL, equivL; private JFormattedTextField gradeTF, equivTF; private … | |
Hi All, Can any one help me in editing a column value in a table and save the changes to the database I am usig a piece of code as follows [CODE] private void process() { // Wait Cursor. CBRCursor waitCursor = new CBRCursor(this); try { // Get the chosen … | |
Good morning all. I've run into a slight stumbling block with some code I'm writing. I'm sure you've all seen the numerous Mortgage Calculator threads so I hope you're not too sick of them yet. Basically, I need my code to first ask the user for a decision, then based … |
The End.