3,978 Topics

Member Avatar for
Member Avatar for judeabao

heres's my code : [CODE]/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package javaapplication11; import java.awt.*; import java.awt.event.*; import javax.swing.*; /** * * @author Jayson Jude */ public class JavaApplication11 implements ActionListener { private JFrame window = new JFrame("Tic-Tac-Toe"); …

Member Avatar for Taywin
0
165
Member Avatar for dennysimon

hello all I found the sample code ,but do not understand how the author found the value of width and height in the frame,anyone can tell me ? frame.setSize(120, 285); According to my count the value must be : frame.setSize(110,250); thank you denny [code]import javax.swing.*; import java.awt.Color; public class Traffic_Lights{ …

Member Avatar for Majestics
0
109
Member Avatar for hiralarious

Hi!(: Sorry, I'm totally new and have no real idea about what I'm supposed to tell you. I just really need some help on my java homework so anything would be much appreciated. (: I feel like I'm already asking for so much.. so I'm really sorry, but can someone …

Member Avatar for hiralarious
0
179
Member Avatar for blondielox

I am working on part five of the Farmers Market program and am ready to pull my hair out. Not getting much help from the instructor either. here is the code [code] /* * To change this template, choose Tools | Templates * and open the template in the editor. …

Member Avatar for NormR1
0
187
Member Avatar for sirlink99

I am trying out something new and I am wondering if this is valid and is not working because of some other code glitch. Graphics class: [CODE]import java.awt.*; import javax.swing.JPanel; public class Drawing extends JPanel{ KeyCommands kc = new KeyCommands (); public void startGraphics (){ System.out.println ("Adding KeyListener"); addKeyListener (kc); …

Member Avatar for sirlink99
0
151
Member Avatar for Dersev

Hello I have a problem how to make custom defined text area it's similar to text area which you can create in Photoshop while you wan't type any text. Is it possible to do it in swing ?

Member Avatar for JamesCherrill
0
127
Member Avatar for Mi_99

So my title was meant to be array not loop I need to create an application that will generate random spots so far my work is this [CODE]import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.*; import java.util.Random; public class Shape{ private int x; private int y; private int width; private …

Member Avatar for JamesCherrill
0
203
Member Avatar for J-Dub

I am trying to build an animation. It just has two pictures or scenes. I want it to start at one picture and end at another. When I run my project all I see is a blank screen. I have checked and made sure that my Image paths are correct. …

Member Avatar for J-Dub
0
192
Member Avatar for kweigand

First off, I am a Java Noob coding in latest version of NetBeans. I am trying to create a program the will allow the user to enter two decimal values: time and earnings in a swing GUI. [B]Basic Flow[/B] [LIST=1] [*]The user will enter the values in two different text …

Member Avatar for kweigand
0
175
Member Avatar for cgull

Hello, I have downloaded a jquery gallery and made a lot of changes to it. Now I am stuck with one thing that I can't change. The gallery has thumbnails that scorll on the bottom. I want the direction of the big image animation to change. It is hard to …

Member Avatar for AleMonteiro
0
215
Member Avatar for sohiabmaroof

hi all m having problem deleting table row from button in jtable .here is my error when i press on delete button this code is similar to my original code . please i need immediate feedback m stuck in this error from days.this is the error [code]Exception in thread "AWT-EventQueue-0" …

Member Avatar for sohiabmaroof
0
2K
Member Avatar for SUBZERO-08

Hi, I am working on a calculator using Java Swing, and have it done, but I was wondering how you would make it so, say when a certain keyboard button is pressed, that number will appear in the text box. Currently, it works so when you press said JButton, that …

Member Avatar for JamesCherrill
0
163
Member Avatar for hacknayan

My problem is that the image is not showing on my java. here is my code MyGame.java [CODE]package mygame; import javax.swing.*; import java.awt.*; import java.awt.event.*; public class MyGame extends JFrame { Container c; Player p; MyGame() { this.setTitle("My Game"); this.setSize(600, 400); this.setLocation(100, 100); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); c = this.getContentPane(); p = new …

Member Avatar for hacknayan
0
143
Member Avatar for SasseMan

Hello! I have a swing app with lots of components and stuff. I want to place a Container/Jpanel on top of everyting else that is invisible that contains other component which are visible. I can make the panel invisible or not opaque and still show its child component but I …

Member Avatar for mKorbel
0
953
Member Avatar for priyasubh

Hi.. I have downloaded a code to add JRadioBuotton to JTable, modified it.Please see the code..What i wanted was to have blank cell...i was getting a NullPointerException for this so i tried adding a JTextBox for instead. When I click on only radiobuttons the code works fine.. if i click …

Member Avatar for mKorbel
0
1K
Member Avatar for Samar Sharma

hay this is samar here actually i have to get values from tha my sql foe a perticular string which i pass through a xt box i think i'm not able to pass the vehicle no. to the querry this is my cade pls help [code]package p2c; import java.awt.Container; import …

0
68
Member Avatar for 918_Nix

I wrote a bit of code at school using a copy of Net Beans that they have installed on the computers in the lab at my school. I saved my file to my thumb drive as Lab2.Java. When I got home I opened my copy of Net Beans 7.0.1 and …

Member Avatar for 918_Nix
0
274
Member Avatar for blondielox

I have pretty much gotten my program to run with one little exception. It is asking for the SKU number which has been set but when I run the program it assigns a number to item and does not give me the sku number I had entered in the program. …

Member Avatar for NormR1
0
119
Member Avatar for aFACE

I am having problems figuring out how to get the results from the strings and then give myself the option to sort through them alphabetically (or numerically). I have the code to the point where it shows the input data but don't know where to go from there. I'm fairly …

Member Avatar for JamesCherrill
0
124
Member Avatar for raaif

Im trying to change the title of a mp3 file but it doesnt work ans also error An attempt was made to move the file pointer before the beginning of the file pops up at file seek ive comented it out (ie. '///###@@) in the WriteID3v11() sub heres my code …

Member Avatar for raaif
0
153
Member Avatar for c.pentasuglia

I am working on an assignment for school and i seem to be having some issues. I am using OpenGl with free glut, and attempting to animate a pendulum. I can draw out the pendulum, but cannot determine how to make it swing. I have to make it swing from …

Member Avatar for c.pentasuglia
0
484
Member Avatar for sohiabmaroof

hi all i m facing problem populating jtable with the data of database !m using arraylist to populate jtable .but the problem is that m unable to add databse data into jtables.i m only getting the last row elements of databse. i should be getting this data in the jtables …

Member Avatar for sohiabmaroof
0
192
Member Avatar for lynnb86

I have all my code done, but it keeps saying no suitable constructor found (close to the bottom on the first code- ProduceInfo pInfo section- line 150) and cannot find symbol (line 62). I have read over this code, searched the errors on the net, and watched videos to try …

Member Avatar for lynnb86
0
159
Member Avatar for ankit.pandey3

[CODE]import javax.swing.*; import java.awt.event.*; import java.awt.*; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; import java.util.TimerTask; /** * @author Adrian BER (beradrian@yahoo.com) */ public class PopupAnkit extends JPanel implements ActionListener{ private JToggleButton invokePopupButton; private JFrame popupWindow; Statement stmt=null; ResultSet rs=null; // int tempCount=0; public static int count=0; /** * Constructor. …

Member Avatar for ~s.o.s~
0
418
Member Avatar for srinidelite

[CODE] import javax.swing.JFrame; public class snake extends JFrame { public snake() { add(new Board()); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setSize(320, 340); setLocationRelativeTo(null); setTitle("Snake"); setResizable(false); setVisible(true); } public static void main(String[] args) { new Snake(); } }[/code] This is Board.java file: [code]import java.awt.Color; import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Image; import java.awt.Toolkit; import java.awt.event.ActionEvent; …

Member Avatar for srinidelite
0
196
Member Avatar for hopstank

hi i am trying to make a CAD program that read a text file which contain a vertecises and number of triangles, which look something like this"the file" : 8 -2.0 -1.5 -0.5 2.0 -1.5 -0.5 -2.0 1.5 -0.5 2.0 1.5 -0.5 -2.0 -1.5 0.5 2.0 -1.5 0.5 -2.0 1.5 …

Member Avatar for NormR1
0
190
Member Avatar for kiko11

[CODE]/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package schedule; /** * * @author Kix */ import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.sql.*; public class Fourth extends JFrame { static JLabel lblFaccode,lblFaculty,lblSpace,lblSpace1; static JButton btnExit; static JTable tblOne; …

Member Avatar for Taywin
0
172
Member Avatar for vaironl

Hello forum vaironl here, I'm having a little bit of trouble with a school assignment which is storing up to 10 names and printing them out in the command box or just printing out the names if the user presses -1. For some reason my loop doesn't wait for the …

Member Avatar for stevanity
0
2K
Member Avatar for ozgamu

What happens is that when i run my program from netbeans it works fine and it shows all the images but when i run the .jar file it doesn't show any of them...the images are declared below the "//Imagenes automata" comment by the way, im new in Java so please …

Member Avatar for peter_budo
0
156
Member Avatar for Curt1337

Hi there all, I really need help on this one, I went away for a wedding for a week and missed a week of work and now I have a practical due for 1:00 10 tomorrow and I got back today, but I managed to complete all of the programming …

Member Avatar for Ezzaral
-2
393
Member Avatar for sohiabmaroof

hi i studied ur post in this link [url]http://www.daniweb.com/software-development/java/threads/118194[/url] but i m unable to edit the default table here is its code [CODE]jTable1 = new javax.swing.JTable(); [B]jTable1.setModel(= new javax.swing.table.DefaultTableModel([/B] new Object [][] { }, new String [] { "Book Name", "Author Name" } ) { Class[] types = new Class …

Member Avatar for 115harman
0
211
Member Avatar for Knoxx

i've been working on my minesweeper project and i seem to be running into a little trouble. My program compiles but my problem is setting the mines on my grid. I have used a random generator to set the positions but i dont know how to implement it on my …

Member Avatar for NormR1
0
183
Member Avatar for stevanity

Im a Junior in college now (Computer science Engineering). Im planning to start my Java certification. Im comfortable with programming in java. Im familiar with most common API and also with swing and Collections, Concurrency, etc. and also with OOPS concepts. So I thought I might take an entry level …

Member Avatar for peter_budo
0
132
Member Avatar for harsimran05

when i use border layout and centre alignment, my label content is appearing on left side but i need it on right side, suggest any change here is my code [CODE]import java.awt.*; import javax.swing.*; import java.awt.BorderLayout; class Welcum extends JFrame { Container c; JButton bFd,bAcct; JLabel lWelcome; public Welcome() { …

Member Avatar for harsimran05
0
98
Member Avatar for jtodd

Hey guys! I am kind of new to Java and am having issues understanding why this code will not run. Any advise would be greatly appreciated! Thanks in advance! [CODE] // Phone.java // Program creates a GUI that resembles a phone with functionality. import java.awt.*; import java.awt.GridLayout; import java.awt.event.*; import …

Member Avatar for JavaStudent321
0
432
Member Avatar for neemo6

Well I just got a new latop with windows 7 and downloaded textpad 5 to do my java homework. At first I had issues just trying to compile but then found out that i needed to point textpad to javac.exe for it to compile. Now my problem is i cant …

Member Avatar for Taywin
0
218
Member Avatar for laitingfei

So I've made a game called HangMan, but it still needs the finishing touches. Anyways, a bit about the game... A JFrame shows 26 buttons for the letters of the alphabet and a whole set of other buttons to make up empty slots (they eventually will be filled in everytime …

Member Avatar for Taywin
0
313
Member Avatar for SasseMan

Hello! I am writing an application for an embedded system with GUI written in swing. I now want to incorporate animations in the GUI to enhance usability. Hypothetical example: The user sees a table with some buttons ant things around it. The user can temporarily "save" the table, which makes …

Member Avatar for SasseMan
0
118
Member Avatar for Bob1000

okay so ive finished this code but now i have to modify it so that it uses the following lines of code to make the program "easier" to understand private static void writeText(BillboardInterface billboard, int x, int y, String text) private static void writeLetter(BillboardInterface billboard, int x, int y, char …

Member Avatar for stevanity
0
128
Member Avatar for behemothdave

Okay I am working on arrays in class this week and since it is an online course I don't have anyone to turn to. YAY me! Basically this is what I have been asked to do. [I]Create a class named TVShow.java. Data Fields can include a String containing the Name …

Member Avatar for behemothdave
0
249
Member Avatar for kiswah03

Hi, I have created an applet in which it is possible to select a shape from the combo box and the the shape moves with the mouse.Everything works just fine except a few problems. 1. The combo box is only displayed when mouse is moved over it. 2. The triangle …

Member Avatar for JamesCherrill
0
143
Member Avatar for Stjerne

Hello guys, I've recently started programming in Java, and I need help with one "assignment" that I found on one of our universitys website (Norwegian). It's like this ( I will translate as good as I can, please leave a message if you don't understand ): [CODE]< necessary import-packages > …

Member Avatar for peter_budo
0
112
Member Avatar for gispe

Hi all, Im starting to program in java with sql. The problem im having is that when im trying to complete a combo box with data from a table in sql i get this error: [U]"null error in cargarComboProvincias()"[/U] when i run the program, and i cant find the error …

Member Avatar for Ezzaral
0
165
Member Avatar for mozy1691

i have a project which am half way done but on compling ma code it shows errors i need help to clean it on login it should display a new JFrame with three labels and five buttons with actions when the book id is entered it should retrive the book(bkbtn) …

Member Avatar for NormR1
0
229
Member Avatar for traxzer

Hey I´m getting some errors, could anyone please help me to get rid of them? Main code [code] import javax.swing.JOptionPane; public class Kontotest { public static void main(String[] args) { Konto bok = null; String navn = JOptionPane.showInputDialog( "Skriv inn navn"); String nummer = JOPtionPane.showInputDialog( "Skriv inn kontonummer"); String saldo …

Member Avatar for JamesCherrill
0
2K
Member Avatar for dennysimon

Hi all I try to copy paste from a site java example ,there are 3 files,Main.java,Login.java,and LoginDialog.java. I can compile Login.java ,but when I compile LoginDialog.java,it said that it cannot find symbol Login.authenticate (a method in Login.java) I have check that there is this Login.authenticate method to make clearer I …

Member Avatar for jwenting
0
1K
Member Avatar for chikkisherry

I've written a code tat reads x and y co ordinates from a txt file and drawlines on the panel. i need to save the written geometry on the panel as a jpeg image, can any one help me out wat should be written in the action listener part of …

Member Avatar for JamesCherrill
0
973
Member Avatar for harsimran05

[CODE]import java.awt.*; import javax.swing.*; import java.sql.*; import javax.swing.text.MaskFormatter; import javax.swing.table.DefaultTableModel; import java.util.Vector; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseListener; import java.awt.event.MouseEvent; class MyFrame extends JFrame implements ActionListener,MouseListener{ Container c; JLabel lAccountNo,lAName,lDateofOpng,lAddress,lContactNo,lTotalBalance; JTextField tAName,tContactNo,tTotalBalance; JTextArea tAddress; JFormattedTextField tDateofOpng,tAccountNo; JButton bAdd,bNew,bDelete,bExit,bUpdate; DefaultTableModel mAccthld; JTable tAcctHld; MyFrame(){ c=getContentPane(); setSize(Toolkit.getDefaultToolkit().getScreenSize()); setTitle("Account Holder"); setLayout(null); lAccountNo=new JLabel("AccountNo."); …

Member Avatar for JamesCherrill
0
163
Member Avatar for bsb_12

An hourly employee is paid at a rate of 125 per hour,from the workers gross pay,12% withheld for income tax,and 15 withheld for union dues. If the worker has 2 of more dependents additional 120 for health insurance. Write a java program that will input the total deduction,basic salary,gross pay …

Member Avatar for NormR1
0
287
Member Avatar for PHkiDz

please help me in my code the error appears and i can`t figure it out. i used to write a program that will accepts the user input, but only a word then the program will scramble the word that had been inputted by the user and display it on JFrame(WINDOW) …

Member Avatar for peter_budo
0
188

The End.