3,978 Topics

Member Avatar for
Member Avatar for TheWhite

This is the snippit im having a problem with. I've tried playing with the preferred size of both the JList and the JScrollPane with no luck/mixed results. I want to be able to size it to exactly 1 size so it never changes. [CODE=JAVA] import java.awt.BorderLayout; import javax.swing.DefaultListModel; import javax.swing.JFrame; …

Member Avatar for TheWhite
0
1K
Member Avatar for Gueito

I am having an issue where with my program and reading all the posts on your site has been VERY useful in understanding this project thank you! Now for my issue i am having trouble getting the buttons to recognize the class provided for them. For instance (i use Netbeans) …

Member Avatar for Freaky_Chris
0
147
Member Avatar for emint

hi i got problem in ma program. in my pro i got main window when i click on "Maze 1" button it create maze. it worked fine. when maze is created i slove maze. then i close to return main window. now when i hit the "maze 1" button it …

Member Avatar for emint
0
116
Member Avatar for caierhui

//The Calculate and exit button does not appear every time i run the program... HELP PLEASE.... import java.awt.event.*; import javax.swing.*; import java.awt.*; public class Assign_1 extends JFrame { private static final long serialVersionUID = 1L; private JLabel quizOneL,quizTwoL,quizThreeL,quizFourL,AverageScoreL; private JTextField quizOneTF,quizTwoTF,quizThreeTF,quizFourTF,AverageScoreTF; private JTextField weightOneTF,weightTwoTF,weightThreeTF,weightFourTF; private JButton calculateB, exitB; private CalculateButtonHandler …

Member Avatar for quuba
0
107
Member Avatar for Evil_genius82

hey guys, im very new to java so bare with me... i cant seem to bubble sort my arraylist... The data needs to be displayed unsorted in a jlist, then when user clicks process the list is sorted according to student id. If anyone could guide me through it would …

Member Avatar for Evil_genius82
0
260
Member Avatar for mustafaneguib

hey all, i am now making a gpa calculator. i am using 4 classes which form into seperate linked lists. one linked list is for the custom gui, and the other linked list is for the data list. i am using custom images for this program which i import using …

Member Avatar for mustafaneguib
0
183
Member Avatar for MonicaClare

i have a problem for this program . how can i use the program in the middle.. i tried to put it IN .. but many error exist.. please help me with my program .. thanks.. here's the output: Enter Name: Simplicio Enter Password: pOLOtAn 1 Capital constant letter/s 4 …

Member Avatar for Godstryke
0
210
Member Avatar for MasterGoGo

Hi, I'm trying to add windowClosing into my program, so that when ran, I can exit by clicking on the X(top right corner). The bold is what i added to try making the windowClosing work. I keep getting errors though. Anyone know what I can do to fix this? errors: …

Member Avatar for MasterGoGo
0
213
Member Avatar for shivaa

Question - Three stacks can be used to sort a list of numbers. Assuming stack in holds the input list of numbers, stack out is to hold the output list after sorting the numbers and temp is used during the sorting process. The sorting algorithm follows. 1 set up stack …

Member Avatar for shivaa
0
85
Member Avatar for Shaun1987

Hi, I am very new to Java and am using Breezy Swing. I basically need to create an array of JButtons (26 in total) and display them on a form (9 on the top row, 9 in the middle and 8 on the bottom) and I have no idea of …

Member Avatar for anand008
0
1K
Member Avatar for ndoe

hi all!i have problem to show JPanel in netbean with button here's the code [code=java] private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed NewJPanel x = new NewJPanel(); x.setVisible(true); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 30, Short.MAX_VALUE) .addComponent(x) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 30, Short.MAX_VALUE) .addComponent(x) ); [/code] my question how …

Member Avatar for ndoe
0
143
Member Avatar for MonicaClare

hi to all programmer... i have a problem about this program .. an error exist .. [code="java"] import java.io.*; import java.awt.Graphics; import java.util.Random; import javax.swing.*; public class midquiz 2{ // "{" expected public static void main (String [] args) throws IOExeption{ BufferedReader 9new InputStreamreader (System.in)); String name,pass,ans; String pass1="pOLOtAn"; int …

Member Avatar for puneet88
0
188
Member Avatar for jdfskitz

I just Started Java BUT I'M FOR SURE I CAN GET A HANG OF THIS! ive typed these pages out and Cant Find the Problem.. I NEVER START OUT EASY!! SO FAR EVERY TIME I START OUT EASY I LOSE WHERE I AM!! so this is a rotating 2d picture.. …

Member Avatar for jdfskitz
0
213
Member Avatar for buchanan23

Hi everyone. So here is my dilemma, I am working on my final project, tackling it one item at a time, so this post is strictly for help deleting a record out of my array. I think I have everything set up right to call to a Method I am …

Member Avatar for buchanan23
0
113
Member Avatar for Web_Sailor

I donno why I am not able to get the popup for this JTree. This tree is found almost in all tutorial ? [CODE]import java.awt.*; import java.awt.event.*; import java.io.*; import java.util.*; import java.text.SimpleDateFormat; import javax.swing.*; import javax.swing.tree.*; import javax.swing.event.*; public class FileTree2 extends JFrame { public static final ImageIcon ICON_COMPUTER …

Member Avatar for Web_Sailor
0
188
Member Avatar for jooa

Hi, I have written two classes. One is a pixel grabbing class the other allows the user to open and display an image. What I now want to be able to do is use the image which the use opened in the RunProgram class and grab pixels from it using …

Member Avatar for jooa
0
120
Member Avatar for BSkiLLs

Hi, What's up everybody ? Names B.SkiLLs or Bones. Wanted to swing through as i seen and came by this forum a couple times, plus was referred a couple times by google while i was searching for something so i figured i would go ahead and join. Seems pretty nice …

Member Avatar for BSkiLLs
0
57
Member Avatar for ndoe

hallo all! how to make a multiple choice quiz with radio button for swing application!my problem in radio button! i have 5 question in my quiz and for each question have 4 answer!how to make user just can choice 1 in each question!i have to try but i just can …

Member Avatar for peter_budo
0
85
Member Avatar for Clawsy

Hello, I'm a little bit new to Java and I use NetBeans 6.5.1. I just try to make a window 'by code, manual' (not drag and drop, not visually). This is my code (first I only want and empty window): [code] package javaapplication5; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Cursor; import …

Member Avatar for axeeffect2002
0
147
Member Avatar for biofly

Hi Friends I am new to Java Swings. I am trying to add JTable. But the table is not displaying. I have the following java code (2 files) **************************************************************************************** package edu.ucsc.genome.qa.sigGateWay; import java.io.*; import java.util.*; import java.awt.Color; import java.awt.Container; import java.awt.BorderLayout; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import javax.swing.BorderFactory; import javax.swing.JButton; import …

Member Avatar for kvprajapati
0
166
Member Avatar for mustafaneguib

hi all, this is my first time using JAVA. i know other programming languages, such as, c++, PHP, Assembly. this is a basic personal schedular. for saving the data i am using a custom designed linked list, and for the gui i am using custom gui. the program runs fine …

Member Avatar for mustafaneguib
0
167
Member Avatar for Questions???

Hello, I am a student attempting to complete an assignment for school. The assignment is: Write an application called Palindrome.java that reads in a five-digit integer and determines whether it is a palindrome. If the number is not five digits long, display an error message dialog indicating the problem to …

Member Avatar for Questions???
0
936
Member Avatar for buchanan23

I am trying to set up 4 buttons that will move through my array in the GUI. I am entering 2 items and telling the GUI to spit out the 2nd record. If I can just figure out how to get the "First" button to work, I think I can …

Member Avatar for buchanan23
0
2K
Member Avatar for buchanan23

OK, so here is my problem. I have created this application that inventory's books & magazines. Everything compiles fine. I prompt the user at the beginning to pick the length of the array (stored in numBooks) then when it comes time to pass the array to the GUI, I get …

Member Avatar for buchanan23
0
174
Member Avatar for lakshay

hello java experts, I have made a program for remote method invocation but i am not able to do get output even i am able to do registry socket error it shows during run made. plz help me out if anyone knows.......... 1)name:AuhorServer import java.rmi.*; public interface AuthorServer extends Remote …

Member Avatar for ede
0
168
Member Avatar for Fyrelion

Hi, I'm in a IntrotoOOP class at my school, and my instructor asked me to look up how to fill a Java Swing Class ComboBox with data from a MySql Database. Does anyone know? This question has been quite hard to find any answers on and I have been really …

Member Avatar for oliver_lundag
0
751
Member Avatar for applefat

I have a collection of objects descended from JComponent that are displayed on an object desended from JPanel. Basically these JComponent-based objects are components that can be added and placed arbitrarily and can be dragged about on the panel. The panel is in charge of repainting all the tools/components that …

Member Avatar for VernonDozier
0
114
Member Avatar for oliver_lundag

/* *It's a Running program that generates DBF file *Question is: How can I make an IDX file Out of this. *I tried to changed the extension by .idx but I'm not sure if it is *correct. */ package src.maintenance.DBFextraction; import java.awt.Dimension; import java.awt.Font; import java.awt.Point; import java.awt.Rectangle; import java.awt.Robot; …

0
182
Member Avatar for MonicaClare

hello.. uuhhmm ... i have a problem here.. i want to know how can i do that if the tuition paid "yes/no": "N" .. then message_error exist that "you need to pay first.." ,. and dont print the result,, but if the answer is "Y" then .. it proceed to …

Member Avatar for oliver_lundag
0
811
Member Avatar for MonicaClare

hi.. this is my new program .. i want a fix or constant answer like, when the answer in: Student Name: Monica Clare then it proceed to another question.. but when.. Student Name: blah blah then. it shown error_message that it is invalid answer,, .. please help me debugging this …

Member Avatar for masijade
0
151
Member Avatar for Web_Sailor

I was trying to read a file and print it to the JTextArea in other class. My program complies but its not printing the file content in JTextArea. Here is my MouselIstener Code [CODE]class MySaveMouseListener extends MouseAdapter { MyClass1 myobj = new MyClass1(); public javax.swing.JTextField myjtext = myobj.getTextField(); public String …

Member Avatar for JamesCherrill
0
148
Member Avatar for kg4cxl

New to Java and need some help...I am getting several Errors and I am not sure why here is the code and the error messages: [Code] import java.io.*; import java.util.Scanner; import javax.swing.JOptionPane; import java.util.*; import java.text.*; import java.lang.*; import java.math.*; import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.net.URL; public class …

Member Avatar for di2daer
0
195
Member Avatar for MonicaClare

Hi to all programmers.. i have a problem about this code .. i don't know what to do to this code.. i change a lot of code .. but always appear the error "illegal start of expression" .. I'm a newbie in Java.. please help me in this case.. thanks.. …

Member Avatar for llemes4011
0
179
Member Avatar for rizillion

Hi!, I have created a user inteface named "helpGUI". This user interface contains a JTextArea. I also have created a text file named "help.txt". I need to show the "help.txt" file in the JTextArea. As I'm new to JAVA I have no idea how to do this. Given below is …

Member Avatar for peter_budo
0
751
Member Avatar for sotvisal

import javax.swing.*; class Customer { int id,rate,pre,cur; String name,sex; String read(String n) { return JOptionPane.showInputDialog(n); } int readInt(String n) { return Integer.parseInt(read(n)); } void out(String n) { JOptionPane.showMessageDialog(null,n); } public Customer() { id=1; name="Visal"; sex="Male"; pre=13214; cur=13362; rate=720; } int consumption(int pre,int cur) { return(cur-pre); } int payment(int rate) { …

Member Avatar for kvprajapati
0
142
Member Avatar for llemes4011

Hi. In my attempts to create an email client, netbean's GUI builder has made me very unhappy... so, I decided I'd rather code it by hand... not my best idea, but whatever. Now, I'm trying to nest a Vertical JSplitPane in a Horizontal JSplitPane, and I can't see the left …

Member Avatar for llemes4011
0
94
Member Avatar for the_prox

Hi there, I need to write a program that draws a clock face with a time that the user enters in two text fields (one for the hours, one for the minutes). As far as I can tell I have all the code written, it's now just a matter of …

Member Avatar for VernonDozier
1
176
Member Avatar for VernonDozier

OK, I haven't done much with Serialization. I have a simple program that creates four JPanels with different background colors and adds them to a larger JPanel using a 2 x 2 GridLayout. That larger JPanel is added to a JFrame. I've written my own serialization code to override the …

Member Avatar for VernonDozier
0
1K
Member Avatar for sotvisal

import javax.swing.*; class Customer { int id,rate,pre,cur; String name,sex; String read(String n) { return JOptionPane.showInputDialog(n); } int readInt(String n) { return Integer.parseInt(read(n)); } void out(String n) { JOptionPane.showMessageDialog(null,n); } public Customer() { id=1; name="Visal"; sex="Male"; pre=13214; cur=13362; rate=720; } int consumption(int pre,int cur) { return(cur-pre); } int payment(int rate) { …

0
67
Member Avatar for painless

i m not getting the desired out put .....according to the program ,it will have to give the movement of the circle in the direction of the diagonal. [code=java] import javax.swing.*; import java.awt.*; public class DrawCircle{ int x=70; int y=70; public static void main(String[] args){ DrawCircle dc = new DrawCircle(); …

Member Avatar for kvprajapati
0
110
Member Avatar for srrjason

I have written some code for an Inventory program that I am working on for a Java Class. I keep getting the cannot find symbol error. I have been trying to fix it and can not. Some simple guidence would be nice. Here is what I have already with errors …

Member Avatar for VernonDozier
0
152
Member Avatar for einhachi

Here is a basic program I compiled and tried to run. import javax.swing.*; [code]import java.awt.*; public class GUITest extends Frame{ public GUITest(){ super("A basic GUI"); JPanel panel = new JPanel(); panel.setLayout(new GridLayout(2,2)); setVisible(true); } public static void main(String [] args){ new GUITest(); } } [/code] When I run it, the …

Member Avatar for painless
0
184
Member Avatar for cognitiaclaeves

You might have seen my lurking around on #Daniweb while I am at work. I thought I'd give you an idea who was behind that tongue-twisted nick. I go by "J", for reasons that are mostly historical. I suppose you could say at this point that I'm growing back into …

Member Avatar for happygeek
0
148
Member Avatar for cebubinary

hi im new to java and im learning about how to add/remove panels from another panel... [COLOR="red"] This is my main frame[/COLOR] [code=java]import java.awt.*; import javax.swing.*; import java.awt.event.*; public class DynamicFrame extends JFrame{ private JButton jb = new JButton("Remove"); private JPanel jp = new JPanel(); public DynamicFrame(){ jp.add(jb); add(jp); setVisible(true); …

Member Avatar for cebubinary
0
299
Member Avatar for karamjeet2004

[code=java]import javax.swing.*; import java.awt.*; import java.awt.geom.*; import java.sql.*; public class panel extends JFrame implements ActionListener { ResultSet res; Connection conn; Statement stat; String lang; JFrame frame = new JFrame("Graphics Button"); lang="abc"; JButton b1; JLabel l1,l2,l3; JPanel p,p1,p2,p3,p4; p.setSize(100,100); p.setLayout(new GridLayout(3,0)); p1=new JPanel(); p2=new JPanel(); p3=new JPanel(); p4=new JPanel(); l1=new JLabel(lang); …

Member Avatar for karamjeet2004
0
187
Member Avatar for dchaosblade

Hey, I'm hoping someone can give me a hand here...I'm currently writing a JApplet which uses several buttons on several different JPanels. Two of these buttons use an image and label (e.g. I did [icode]contestant.setIcon(cc); contestant.setText("C.C.");[/icode] where contestant is the button, and all formatting occurs just after and the Image …

Member Avatar for dchaosblade
0
159
Member Avatar for Debby0424

[code=JAVA] import java.util.Arrays; // Class that hold a collection of CD objects class Inventory { // maximum number of CDs that will be held static public final int MAX_NUM_OF_PRODUCTS = 10; private CD products[] = new CD[MAX_NUM_OF_PRODUCTS]; // number of CDs currently in the inventory private int numOfProducts; // default …

Member Avatar for Debby0424
0
233
Member Avatar for painless

plz help me out ... i m using the following code to display an image which resides on my pc (C:\Users\vivek\Pictures\firefox,JPG)... but when i run the code ....there is no compile time error..n also not any run time error..n the output is a empty frame :'( [code=java]import java.awt.*; import javax.swing.*; …

Member Avatar for painless
0
133
Member Avatar for suretd

Hi All, For my final assignment, I need to create a BookCatalogue and save the data to a file on the disk. I have created a Book class that get and inserts the fields: Book title, author and type. [CODE] public class Book { private String title; private String author; …

Member Avatar for di2daer
0
133
Member Avatar for VernonDozier

I have a movie-player type application. You have a movie of JPanels that you can "play", that is you can have the frames change either automatically on a timer or by advancing a frame at a time manually. I've created 4 trivial frames (simple JPanels with different colors). It can …

Member Avatar for kvprajapati
0
3K

The End.