3,978 Topics
![]() | |
I need some assistance with three things in my code. My problems are: Next and Previous buttons do not loop through the array, instead they throw exception errors when they get to the end of the array. Second my image that is required does not show up, my instructor said … | |
My problem is getting snum in the main class to transfer over to the sub class, so that the snum in that class = snum from the main class The code is; [code] package workstation; import java.util.Random; import javax.swing.*; public class Main { public static void main(String[] args) { int … | |
hello! i written a program..it has for loop and calling thread.sleep for every increment of for loop.. at the same time i initially called Swing Jtable which shows status of every for loop increment... when i executing main program swing table appearing but no content filled for every execution ... … | |
Hi everyone please help on this: I am developping a program in java, but I need the user to enter his/her details if they are compatible with the values in a database table he/she get access to the main interface. here is what I've done so far [CODE]import java.awt.BorderLayout; import … | |
hi ! Happy new Year!!!! I struggling with open IE browser within swing .... like frame content pane showing IE... any help please...... | |
I'm hoping someone out there can help me. i have to use a 2nd class to create a JMenuBar to attach to a JFrame i get an error :49: incompatible types found : javax.swing.JFrame required: java.lang.String return aTestFrame; (i have also tried something else and got a static/non static error) … | |
Hello, is there an acceptable way to do the following? [CODE=java]public CriarEquipamentoGUI (boolean showWindow) { if !(showWindow) dosomething(); return; else initComponents(); }[/CODE] Currently the return statement completly screws up the window. | |
Hi all, Here i pasted some code, In that i added to images to container but it is displaying the last one only, and one more thing is how to set the boundaries for jbutton, TextArea and Image. I need the code of count down timer. Thanks in Advance............... [code]import … | |
A summary of the errors I have received can be found here - [IMG]http://i46.tinypic.com/2cdcvat.jpg[/IMG] [CODE]import javax.swing.event.*; import javax.swing.*; import java.awt.*; import java.io.*; import java.net.*; import java.applet.AudioClip; public class Whackan extends JFrame implements ActionListener { JButton[][] spots = new JButton [ 5][ 5]; JLabel score = new JLabel(); int maxDelay = … | |
hi everyone, i have been asked to make a basic calculator but my calc only holds two integers like 2+2 it cant do more than 2 operations so id reaaly be glad if someone could take a look at my code and see what the problem is asap.im still a … | |
First off no idea why the title doesn't say the full title, but My problem is getting snum in the main class to transfer over to the sub class, so that the snum in that class = snum from the main class The code is; [code] package workstation; import java.util.Random; … | |
Hi, I'm building a snakes&ladders game in java. so far i have the model ready, i'd like to make the UI in swing. my problem is to paint the dynamic board using swing, i need to paint a snake/ladder from one square to another, the problem is that so far … | |
I'm completely new to java and am trying to get some experience with programming java applets that can be opened from a browser. I was able to successfully open a simple "hello world" applet from a browser using the below javascript: [CODE]<script src="http://www.java.com/js/deployJava.js"></script> <script> var attributes = { code:'HelloWorld.class'} ; … | |
hi, please assume it is already connected to the access database( it is connected) since i could get all the data out and put them onto a JTable. What is wrong now ... is that i am trying to insert new data to the access db and i got [code] … | |
Hi guys I am trying to build a program which scans data from a text file, but I keep getting an error when trying to compile it. The code [CODE] import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.Scanner; import java.io.*; class anything extends JFrame { public anything() { File stuff … | |
Hi all, I'm new to Java (after years of Visual Basic and VBA). So right now I'm going through a very steep learning curve. I'm trying to figure out (while I bang my head on the keyboard) how to do the following in SWING: - Show mouse coordinates (x, y) … | |
Hi, ive been looking for a solid java community to help me when im tearing out my hair :) Basically ive constructed a GUI that has to represent the same look and functions of the typical windows calculator. Ive made 4 classes 2 do this, my reasoning so it was … | |
Hello. I am writing an ATM program for a project, but I am having problems matching the users entered pin with what is stored on the text file. Here is how i read the file [CODE]import java.io.File; import java.util.Scanner; import machine.*; import javax.swing.JOptionPane; public class FileRead { Transactions query = … | |
[code]import javax.swing.*; import java.awt.*; import java.awt.event.*; public class cal extends JFrame implements ActionListener { JMenuBar mb; JMenu file, help; JMenuItem esc, about; JButton btn[]; JLabel lab1 = new JLabel("0"); JPanel pan1; int i; final int MAX_INPUT_LENGTH = 20; final int INPUT_MODE = 0; final int RESULT_MODE = 1; final int … | |
hello guys, I have to implement a classic snake game with java in 3 days but I couldn't figure out how to code yet. If you have a source code or a useful tutorial for the snake game please let me know. My program will be a little different from … | |
Hello, I am developing a simple graph drawing application where each graph could be painted in internal frame. I want to call a specified function whenever an internal frame got focus. I’ve tried to add “addFocusListener” to the internal frame but it didn’t work. Multiple workspace (internal frame) can be … | |
hello can anyone help me with this [CODE] import javax.swing.*; public class Q6 { public static void main ( String args [] ) { int nv,np,ns,nc; int c=0 , v=0 , p=0 , s=0; String input = JOptionPane.showInputDialog(null,"please Enter the statement") ; for (int i=0; i<input.length ( ); i++) { … | |
Hey there guys, I am having a problem with with my ReadFile constructor. First of all the class that I am placing the constructor in is in a different package. I have imported the package to the class that I am placing the constructor But I still get an error … | |
I want to know how to handle the events in an online webplayer using java swing | |
What is the problem here please :'( [code]import java.math.*; import javax.swing.*; public class Q5 { public static void main(String []args) { double n; String Output=""; int t=0; int supervisingyears=0; for(t=0;t<=25;t++) { n=220/(1+10 * math.pow(0.83,t)); if (n<80) supervisingyears++; output=output+"\n Number of Supervising Years"+supervisingyears+"\n"; JOptionPane.showMessageDialog(null,output); } } }[/code] | |
hi! i now implementing laptop playing guitar where my touchpad is to do strumming and keyboard keys is to change chords. when i pressed a key and moving the mouse cursor i can do the strumming, now my problem is when i released the key i still can do the … | |
whats wrong with these code? the buttons don't add or remove the panel.. someone help me!??plss..:S [code=java] import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; public class addremove extends JPanel implements ActionListener{ private JButton addbut; private JButton revbut; private JPanel panel1; private JPanel panel2; public addremove() { addbut = new … ![]() | |
Hello, need help programming a blackjack game for my computer science class. I have used a cirularlinkedlist to create this game. I have received a null pointer exception error. I think it has to do with my circularlinkedlist class. import java.util.NoSuchElementException; public class CircularLinkedList { private ListNode last; public CircularLinkedList(){ … | |
I'm trying to execute this code to open a java GUI to run queries on the oracle express database I have set up but at the actionPerformed() class, I keep getting java.sql.SQLException errors. What I would like for it to do is when you hit the button, that table from … | |
Hi members! Sorry I need a help with this snippet. I am still workin' on it... the thing is all the three buttons ain't working. And Can anyone tell how to compare the values of username and password against a database in Ms access. Thanks Here is my code import … | |
import javax.swing.*; import java.awt.*; public class sample { public static final int width=500; public static final int height=500; public static void main(String[] args) { JFrame mywindow=new JFrame(); myWindow.setSize(Width, height); JLabel myLabel= new JLabel ("How do i insert picture in this window? I want to create a photo gallery on this … | |
"Write an applet that draws the house (house Rectangle white, two quader windows black, triangle ruff white, rectangle door black. When the user user clicks on the door or windows, they should close, The figure should look clear ruff, clear house rectangle, clear door with door opener (circle black), windows … | |
what is the main function for this variable in the code [CODE]int n= 1;[/CODE] [CODE]import javax.swing.*; public class Qustion3C{ public static void main (String args[]){ int[] a={1,4,9,6,1,9,7,8,2}; int x; int n= 1; <<<<<<<<<<<<<<<<<<<<< wondering about this String c; c= JOptionPane.showInputDialog(null, "please Enter x value"); x= Integer.parseInt(c); for (int i=0; i<a.length; … | |
I'm creating a simple desktop application using java. For that I would like to create my own look and feel. But I feel helpless .... Could anyone provide me guidelines in doing this.. If possible would you please provide me some useful, simple websites (explaining the basics) regarding swing-look and … | |
i am having trouble putting together all the pieces of the puzzle to work together in harmony. My final project is simple,i have a jlabel with the question of how much does your dog weigh, I have a button and a jtextfield, the user enters the amount of there dog, … | |
I have a poker game that mostly works. When I run the program, the players only get Flush and Straight Flush hands. [CODE=syntax] public class Card { private String face; private String suit; public Card(String cardFace, String cardSuit) { face = cardFace; suit = cardSuit; } public Card(Card c) { … | |
I made a poker game and when I run it I get these errors... [CODE=syntax] Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at PokerGame.Hand.getPairs(Hand.java:82) at PokerGame.Hand.whichHand(Hand.java:28) at PokerGame.DeckOfCards$1.actionPerformed(DeckOfCards.java:67) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236) at java.awt.Component.processMouseEvent(Component.java:6263) at javax.swing.JComponent.processMouseEvent(JComponent.java:3267) at java.awt.Component.processEvent(Component.java:6028) at java.awt.Container.processEvent(Container.java:2041) at java.awt.Component.dispatchEventImpl(Component.java:4630) at java.awt.Container.dispatchEventImpl(Container.java:2099) at java.awt.Component.dispatchEvent(Component.java:4460) … | |
Hai Friends, Am programming in java swing, am using scrollane with scrollbars, i want to move the scrollbar at the middle of the panel at starting,am used setvalue but it not setting the given value. please reply me the solution for this problem. | |
So my code does everything I want it to do with the exception of when writing to storage I am not sure how to make true and false write as 1 and 0 respectively. I do not know if it's my syntax or my placement within my program...Kind of lost … | |
please help me ^_^ I want using thread in this program but I don't know ..?? ____________________________________________________ [CODE]import java.util.*; import javax.swing.*; import java.awt.*; import java.awt.event.*; //------------------------------------------------------------------------------------------------ public class MyApp extends JFrame { // Data static boolean stopped = true; // Is the counting stopped? (True or False) --> shared variable … | |
i have experience in php but i need to persue my career in JSP. Anybody suggect the site where i get jsp freelance project. i am ready to project free also.i have very good knowledge in j2ee application(swing.struts,ejb,javabeans) and have very good knowledge in web technology. | |
Hello again, got another Java question. I am trying to draw an oval from the Alien class to the Canvas in the Game class. Here is the code [CODE]import javax.swing.*; import java.awt.*; /** * The Evil Ovals! * * @author Eric Foertsch * @version Nov 2009(1.0.0a) */ public class Alien … | |
welll it is just a program that generates 2 random numbers for the user...the user inputs their answer and if it is correct it adds 1pt to their score. But then it is also supposed to generate a new problem, but I do not know how to code that in. … | |
I have an program that allows a user to input their employee name and number and then their hourly wage and their total number of regular hours and overtime hours. Then writes out the data to a binary file. The program I need assistance with reads in that file, adds … | |
Please help me ... a NullPointerException appears here's the codes import java.util.Random; public class Dice { Random r =new Random(); int sides; //constructor public Dice(int s){ sides = s; } //roll method depending on sides on top public int roll(){ return r.nextInt(sides-1)+1; } } // end of class public class … | |
Hey guys and gals, So for my Java class, (which I have been struggling all semester with) we are supposed to break down a code and say which park of the code does what and why. I selected a simple program that creates a bar graph. If anyone could give … | |
Hi all, I cant get my brain around the logic of making a check box add a specific color when it is checked. Also, when the other boxes are check, it will add that color to the selected color as well. here is my code: [CODE]import java.awt.BorderLayout; import java.awt.Color; import … | |
I am writing a java applet that calculate heat index and wind chill. it requires the user to input temperature , wind speed and humidity, and then let the user choose either Metric ( kph, °C) or English (mph, °F) I have some problems with the code. First, the Calculate … | |
I'm pretty new to java but have lots of coding experience with ruby, c and gui with gtk2 and qt. I'm trying to understand (and get rid of) the dead space to the far left portion of the window. The split panes have white backgrounds to separate it from the … | |
Can you help me modify this program so that it contains loops within loops somewhere. I have a while loop but that is only one. To pass my task my program MUST contain Loops Within Loops somewhere. Thank you. [code] import javax.swing.*; class team { public static void main (String[] … |
The End.