3,978 Topics

Member Avatar for
Member Avatar for r.stiltskin

The code below is a simplified excerpt which compiles & runs, just to show the problem I encountered. I tried to use BoxLayout in the ColorPanel method, but the JLabel "swatch" was not visible in the frame at all. I found that I can get the effect that I wanted …

Member Avatar for r.stiltskin
0
76
Member Avatar for Laidler

I now have teo classes the first one contains this [CODE]import java.awt.*; import javax.swing.*; class fm1 extends JPanel { public fm1() { this.setLayout(new GridLayout(3,0)); Dimension D1 = new Dimension (300, 300); JLabel fruit1 = new JLabel(); fruit1.setPreferredSize(D1); fruit1.setOpaque(true); this.add(fruit1); JLabel fruit2 = new JLabel(); fruit2.setPreferredSize(D1); fruit2.setOpaque(true); this.add(fruit2); JLabel fruit3 = …

Member Avatar for Laidler
0
125
Member Avatar for nanna

hi, i suppose to make simulation to cellphone. when press any digit ,it should appears on the display textfield to form a complete number. and when press the send button a message with"redialling+ the gigits pressed" appears on the textfield also when press redial button a message with " redialling+ …

Member Avatar for stephen84s
0
179
Member Avatar for Laidler

im trying to program a JAVA GUI but after i compile the code and try to run it i get an error message. i then downloaded a program i made at college and i get the same problem even though it ran at the university. [B]Heres the Code[/B] [CODE]import java.awt.*; …

Member Avatar for Laidler
0
116
Member Avatar for rapture

Hello, I need help on this project for school. My instructions are "Write a program called OfficeAreaCalculator.java that displays the following prompts using two label components: Enter the length of the office: Enter the width of the office: Have your program accept the user input in two text fields. When …

Member Avatar for rapture
0
119
Member Avatar for senthil12345

Hi, I’ve embedded applet in a jsp page. Initially appearance of applet is coming well. After some time during the process of applet , when the browser window is minimized and restored or if we are switching to any other window and coming back to the applet embedded jsp page, …

0
78
Member Avatar for AllenB

Hello, I am trying to insert values from a .csv file into a MySQL database from a GUI. I cannot seem to accomplish this. I keep getting a null pointer exception where I set the connection properties in my main method. I also cannot seem to figure out how to …

Member Avatar for Ezzaral
0
2K
Member Avatar for curtissumpter

Hi, I'm having trouble with using and updating graphics in a JFrame. I'll include my code below along with some classes. They're necessary for the program to work properly. The issue is that the paint method is painting over my UI. Then it won't display the graphics. I don't have …

Member Avatar for Ezzaral
0
998
Member Avatar for evilllllll

My hw is to create a strategy for this rock paper scissors game. this is my code for the game itself: import java.awt.*; import java.awt.event.*; import javax.swing.*; /** *The RPs applt plays Rock paper *scissor, lizard, Spock game and *keeps track of how many times *you won lost or tied …

Member Avatar for BestJewSinceJC
0
116
Member Avatar for mannyg

so i no ive read this stuff about hmwrk. but i have done a lot of work and dont want anyone to finish it for me i just need advice, im making a coffee machine and i have made a layout, but i dont no how to put in the …

Member Avatar for sillyboy
0
126
Member Avatar for ylenaj

What are the codes when you cancel a list of names in the database in a certain field? This is the situation: I made a reservation in a certain hotel. Of course they asked my name, what kind of room. . Automatically, it saved on the database of their system. …

Member Avatar for stephen84s
0
120
Member Avatar for tanha

Hi everybody, I want to have a login form in Java, which comparing the username and password, according to MySQL database data, so I have the following code, just don't know where to add the select statement and how verify the username and password from MySQL with the JTextfield of …

Member Avatar for peter_budo
0
3K
Member Avatar for Alishaikh

I made this applet for my APCOMPSCIA class, it due tomorrow but I cant get it working. I need to show the animation of a sort, but it just does sort once that it, please help. I will be very great full. [CODE]import java.applet.Applet; import java.awt.*; import java.awt.event.*; import java.util.Random; …

Member Avatar for stephen84s
0
90
Member Avatar for ciarz3r

[code=java] import java.util.Scanner; import java.util.regex.*; import java.io.*; import javax.swing.*; /** * A program that parses a user-supplied URL */ public class URLParser { public static void main(String[] args) throws IOException { Scanner scan = new Scanner(System.in); PrintWriter out = new PrintWriter(new FileWriter("D:\\cs2200\\lab8\\URLs.txt")); String input=""; // Everything works the way I …

Member Avatar for stephen84s
0
111
Member Avatar for AllenB

Hello, I am creating a client/server application that verifies math equations for addition, subtraction, and division. I think I just need someone else’s eyes to possibly see where I am going wrong with this. Everything seems to be working fine except for one variable. This is the String serverAnswer variable …

Member Avatar for AllenB
0
138
Member Avatar for lordx78

[code=java] import java.awt.EventQueue; import javax.swing.JFrame; public class tatat extends JFrame { private static final long serialVersionUID = 1L; public static void main(String args[]) { EventQueue.invokeLater(new Runnable() { public void run() { try { tatat frame = new tatat(); frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); } public …

Member Avatar for ~s.o.s~
0
83
Member Avatar for l_03

[CODE] import javax.swing.*; public class A { public static void main (String args[]){ String ask = JOptionPane.showInputDialog("Enter"); if(ask.equals("hello")){ System.out.println("ok."); main(args); }else if(isRepeat(ask)){ System.out.println("Invalid,string has been repeated."); System.exit(0); } } public static boolean isRepeat(String ask){ if(ask.equals("hello")){ return true; }else{ return false; } } } [/CODE] Hello, I am having problems with …

Member Avatar for ahihihi...
0
176
Member Avatar for starsinthesky

i cant figure out what's wrong with my code. can anyone help me pls? [code] import javax.swing.*; import java.awt.*; import java.awt.event.*; public class MyGUI implements WindowListener, ActionListener { public void windowClosing(WindowEvent e) { System.exit(0); } public void windowClosed(WindowEvent e) { } public void windowIconified(WindowEvent e) { } public void windowOpened(WindowEvent …

Member Avatar for starsinthesky
0
112
Member Avatar for llemes4011

Hi, I'm trying to program Tetris. The thing is, I can't seem to get the Keylistener to work in the JApplet, and I have no idea why :( Here's my code: [CODE=java] import java.util.Random; import java.awt.event.*; import java.awt.*; import javax.swing.*; /** * Class Tetris - write a description of the …

Member Avatar for llemes4011
0
323
Member Avatar for AllenB

Hello, I am having a problem writing to a file on a client/server application. I can send the data from a JTextArea to the server, it appears to read the text, but I cannot seem to get the server to write the data to the .txt file. Can anyone help? …

Member Avatar for Antenka
0
170
Member Avatar for navinlearns

I have been working on a program that Should Scan a small Subnet i.e for eg 10.1.1.1 to 10.1.1.255 with the subnet mask 255.255.255.0 I am attaching screenshots of the main screen of my project as "Screenshot 1" source code :jMenu.java I am posting the code here: [code=java] package projectpack; …

Member Avatar for masijade
0
177
Member Avatar for l_03

import java.io.*; import java.util.*; import javax.swing.*; import java.util.StringTokenizer; public class Sample { public static int count = 0; public static String s[]=new String[2]; public static String s2; public static String s3; public static void main (String args[]) throws IOException{ isRead(); } public static void isRead()throws IOException{ int count2 = 0; …

Member Avatar for verruckt24
0
110
Member Avatar for rude04

i used setundecorated(true); to remove the buttons and border of the window,,the problem is the frame only stays where it is, because the title bar is removed i cant drag it around the screen anymore.. what code should i add to be able to drag it anywhere in the scree …

Member Avatar for darkagn
0
218
Member Avatar for lllllIllIlllI

Hi I have been using java.swing for my GUI programs so far and i kinda hit a brick wall, and i think its a stupid one on my account, i cant find a way for something to load a html file to the screen using a java.swing control. This is …

Member Avatar for stephen84s
0
90
Member Avatar for lllllIllIlllI

Hi When using java, for almost all the time i just use java.swing for my applications that i make, yet when using other programming languages i often find that the GUI toolkit that comes bundled with the download of the Development Kit, is not quite as good as some third …

Member Avatar for stephen84s
0
139
Member Avatar for jjaunich

Hi, I've just started a Java course, which is giving me trouble because I've had so much unscheduled overtime. I have three programs due that have small problems that I can't fix no matter how many changes I've made. They are really basic, but I've only been one week into …

Member Avatar for verruckt24
0
152
Member Avatar for JoeK

Can someone point me in the right directions. I have to build on an existing mortgage program. I have to pull interest rates in from an external txt file and have them populate my array. The array will then be used in a combobox pull down. I don't know which …

Member Avatar for JoeK
0
148
Member Avatar for l_03

[ICODE] import java.io.BufferedReader; import java.io.FileReader; import TokenizerProcess.StringTokenizer; import javax.swing.JOptionPane; public class ReadFile { public static int count = 0; public static String[][]file = new String[6][3]; public void isReadFile(){ SubjectInput input = new SubjectInput(); try{ BufferedReader reader = new BufferedReader (new FileReader("SubjectFiles/subjects.txt")); String line; while((line = reader.readLine())!=null){ StringTokenizer tokenFile = new …

Member Avatar for ~s.o.s~
0
148
Member Avatar for radhasb

I am writing a program in which I have done ALOT of coding already but there are still problems and features to be added. So far my program: 1) Takes data from a .dat file and displays it on a table 2) There is a button for which you can …

Member Avatar for quuba
0
393
Member Avatar for radhasb

[CODE]public class table extends JPanel implements ActionListener{ JButton addInfo; public table(String dataFilePath) { JTable table; model model; Font f; f = new Font("SanSerif",Font.PLAIN,24); setFont(f); setLayout(new BorderLayout()); model = new model(dataFilePath); table = new JTable(); table.setModel(model); table.createDefaultColumnsFromModel(); GridLayout layout = new GridLayout(80,30); addInfo = new JButton("Add Data"); addInfo.setSize(80, 30); addInfo.addActionListener(this); //action …

Member Avatar for Ezzaral
0
116
Member Avatar for priya_gurnani

actualy i need help i m making a software in java swing i hv a problem in retriving values from database in JTable, i m inserting values in database ms access it works, following is my code one is for database another one for table ..................................................................................................................................... [code] import java.sql.*; public …

Member Avatar for javaAddict
0
100
Member Avatar for xabi

I'm an elder learning Java, and am somewhat a bit confused when it comes to algorithms and such like. I have had to create an application that when a user inputs a number of crazy frogs hit with a hammer, your points score is given back to you. If 2 …

Member Avatar for Ezzaral
0
123
Member Avatar for PhiberOptik

Hey guys, I'm creating this as an admin program for another program I've made. Basically all that happens at this point is show a bunch of buttons and the titles of the buttons are the computers that the using accounts from my MySQL database. This is just the panel, but …

Member Avatar for PhiberOptik
0
111
Member Avatar for fomi101

I have to sort the bars but i have to show them sort, by delaying it. Can someone help me add delay to make it work. I used Selection Sort --- [code] import java.applet.Applet; import java.awt.*; import java.util.Random; import javax.swing.*; public class SelectionSort extends JApplet { //Variables and arrays Rectangle[] …

Member Avatar for BestJewSinceJC
0
57
Member Avatar for rude04

i want to use a JButton with a rollover sound..so created a button with a sound using adobe macromedia flash... how can i display it in the swf button in jpanel?? here is the button..[URL="http://www.mediafire.com/?p2kbme0czgn"]button.swf[/URL] [code=java] import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; public class MyPanel extends JPanel { …

Member Avatar for rude04
0
163
Member Avatar for trailmaxusa

Can you make a jar with a java database application work outside of NetBeans 6.5 IDE? The application has the included in the library folder: 1. appframework-1.0.3.jar 2. beansbinding-1.2.1.jar 3. derbyclient.jar 4. groovy-all.jar 5. swing-layout-1.0.3.jar 6. swing-worker-1.1.jar 7. toplink-essentials.jar 8. toplink-essentials-agent.jar Application works with IDE running with the Apache Derby …

Member Avatar for verruckt24
0
112
Member Avatar for JoeK

[B]This assignment requires that I allow for user input in a GUI for principal, interest rate, and term in years. I also have to provide a pulldown with 3 preset rates that will also load a cooresponding term length. All of that plus an amoritization table as well. I have …

Member Avatar for JoeK
0
457
Member Avatar for gauravmishra

I am trying to take continuous pictures of small window of my screen and create a continuos motion picture sort of thing and display it on the java panel . For this i am taking snapshots of the screen window by using "Robot" class . but the panel is only …

Member Avatar for puneetkay
0
165
Member Avatar for mercury113

i have this code in java... my first combobox when u choose letter a will be correct... but how will apply in the other combobox that when u choose it... the letter b will be the correct answer?? plzz help me... import javax.swing.*; import java.awt.*; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; public …

Member Avatar for puneetkay
-1
79
Member Avatar for rude04

how do you make a jframe transparent?...i need to add a png or gif image in the frame..so when i run the program it will only show the image..and the image would float in the desktop.. i also need to add a few components like JButton.. i want the frame …

Member Avatar for rude04
0
210
Member Avatar for JamieC90

Can someone explain to me what this is? I have been asked to code a tic-tac-toe board using an array which I have done, but the brief specifies using standard input, and I have no idea what that is, but I'm guessing does not include changing the values of the …

Member Avatar for javaAddict
0
218
Member Avatar for mercury113

i have this code in java swing... im getting an headaChe thinking what to do... how do i add events in my ComboBox?? wHat i want is that when i sElect a comBoBox iT will tell wether the one you selected is correct or wrong... then the comBoBox will be …

Member Avatar for mercury113
0
177
Member Avatar for aznlover

K, well, I'm kind of screwed right now, I am supposed to make a game by using java, and this is all like minor stuff. The code so far, and I have little idea of what I'm doing. I want to make it so that when you click in a …

Member Avatar for puneetkay
0
227
Member Avatar for seeker_89

i'm making a simple program that will accept 7 input using JOptionPane i'm found out that JOptionPane has been used 7 times i want to transform in function i make it but i encounter an error. [code] import javax.swing.JOptionPane; public class SevenWord2A{ public static void main() throws NoSuchMethodError { String …

Member Avatar for stultuske
0
101
Member Avatar for christiangirl

Hey, I am tutoring this kid in java and he has to use TurtleGraphics and BreezySwing, neither of which I have used in a while. I am having trouble figuring out some of his problems. I will post both his code and how I altered his code. I am wondering …

Member Avatar for christiangirl
0
109
Member Avatar for ezkonekgal

before anything else, i have a question. How can you have a multiple stack in one vector using node/linked list? i don't get the concept of linked list yet. Anyways, this is my problem: [B]Create a Java class definition of a multiple-stack in one dimensional vector. Implement the basic operations …

Member Avatar for ezkonekgal
0
310
Member Avatar for kedakai

Can anyone help me with this?.... I got some sample programs to be studied but I don't really know how to remove its bug..I don't know if there really is..but I think there is...there was no error upon compiling but when I try to run it...there is... here is the …

Member Avatar for kedakai
0
167
Member Avatar for boburob

Hey everyone, im writing a blackjack program with java swing and im having problems with setting the layout with panels and frames. I want to apply a different layout to two different panels, add them to a frame and then display the frame, heres my code: [CODE]//Blackjack //By Thomas Bean …

Member Avatar for BestJewSinceJC
0
185
Member Avatar for hctstudent

Hey everyone, heard the people here are good so I thought u were the only ones to help me in this i keep getting these runtime errors [icode] Exception in thread "AWT-EventQueue-0" java.lang.NumberFormatException: empty String at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:994) at java.lang.Double.parseDouble(Double.java:510) at MainClass.actionPerformed(MainClass.java:263) 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 …

Member Avatar for quuba
0
126
Member Avatar for Rameses

This is ClickMe program where it's suppose to change button text once the user clicks the button. Although, program does successfully launch and pops up the "Click ME" button but once it's clicked nothing happens, it doesn't change anything. Any help would be appreciated. import javax.swing.*; import java.awt.event.*; public class …

Member Avatar for BestJewSinceJC
0
93

The End.