3,978 Topics

Member Avatar for
Member Avatar for NickT80

I have this simple project that I'm sure has come throught here before. I am take input from a user using JOptionPane, make sure it is >15 Chars, and count the uppercase. Here is what I have so far. I am having trouble setting the first loop correctly. [CODE] import …

Member Avatar for MxDev
0
134
Member Avatar for tnccjavaMatt

My code outputs the correct answer to both the GUI and to a text file, but it displays it in a list format instead of a clean looking table. What modifications have to be made to assign formatting of output correctly? [CODE]import javax.swing.*; import javax.swing.border.*; import java.awt.*; import java.awt.GridLayout; import …

Member Avatar for BestJewSinceJC
0
714
Member Avatar for wrenz.go

the error...[CODE]Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at javaapplication1.memberTable.AddMember(memberTable.java:21) at javaapplication1.GUI3.memberAddActionPerformed(GUI3.java:2345) at javaapplication1.GUI3.access$000(GUI3.java:28) at javaapplication1.GUI3$1.actionPerformed(GUI3.java:352) 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:6041) at javax.swing.JComponent.processMouseEvent(JComponent.java:3265) at java.awt.Component.processEvent(Component.java:5806) at java.awt.Container.processEvent(Container.java:2058) at java.awt.Component.dispatchEventImpl(Component.java:4413) at java.awt.Container.dispatchEventImpl(Container.java:2116) at java.awt.Component.dispatchEvent(Component.java:4243) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916) at java.awt.Container.dispatchEventImpl(Container.java:2102) at java.awt.Window.dispatchEventImpl(Window.java:2440) at java.awt.Component.dispatchEvent(Component.java:4243) …

Member Avatar for JamesCherrill
0
88
Member Avatar for tnccjavaMatt

I have to write a program that creates a GUI that prompts a user to enter a query, then return the result to the same screen. All the examples I've found in my text book and other course material only shows how to account for a predetermined query. How do …

Member Avatar for tnccjavaMatt
0
883
Member Avatar for Dscyth3

Hey, I'm working on a problem and what I need the program to do is to add up the numbers in the array NOT add up how many numbers there are. There are 5 total numbers that a user will input. The counting of the numbers will be in a …

Member Avatar for kudresov
0
84
Member Avatar for digital_dizasta
Member Avatar for Sandar Khin

Hi all Plz help me about media streaming.I want to play files that transmit from 'rtmp' link at my java application program.I have a program that play from 'http' link.Code is here [code] import java.awt.*; import java.awt.event.*; import java.io.*; import javax.swing.*; import javax.media.*; //import com.sun.media.protocol.rtsp.DataSource; import java.net.*; public class MediaPlayerTest …

0
59
Member Avatar for beshoyatef

Here i mad panel and i put two Boxes in it , then i tried to make a background color for box by useing ([B]background(color.blue)[/B] method) but it never has the color . Then i try to resize its height by useing [B]Box.createRigidArea(new Dimension(10, 50))[/B] but the titleBoard take all …

0
76
Member Avatar for Clawsy

Hello, I build my java desktop application using NetBeans 6.7, visually. So I click on the Frame -> Events -> KeyTyped and I add a new handler. The problem is the key events are not detected! My components are Swing components. Why is this happening?? :( [CODE] private void formKeyTyped(java.awt.event.KeyEvent …

Member Avatar for Clawsy
0
443
Member Avatar for Web_Sailor

Hi, I have a jRadiobuttongroup. I have 3 types of jradiobuttons in my group. [CODE]A B C 1 1 1 2 2 2 3 3 3 4 4 4[/CODE] Now the problem is that when I selected suppose A type of buttons some of the A type buttons get selected …

0
62
Member Avatar for rukshilag

Here is my code - i want b1 to close the window when i press it public class Main { public static void main(String[] args) { javax.swing.JFrame w1 = new javax.swing.JFrame(); javax.swing.JButton b1 = new javax.swing.JButton(); w1.setBounds(0,0,300,300); java.awt.Container c = w1.getContentPane(); c.setLayout(null); b1.setText("Exit"); b1.setBounds(100, 100, 100, 30); c.add(b1); w1.setVisible(true); } …

Member Avatar for gunjannigam
0
91
Member Avatar for ngnt4

[CODE]import javax.swing.*; import java.awt.*; import java.awt.event.*; public class TravelExpenses extends JPanel { private JTextField days; //declaring textfields and labels private JTextField lodging; private JTextField airfare; private JTextField taxiCost; private JTextField miles; private JTextField rental; private JTextField seminarFees; private JTextField parkingFees; private JLabel daysL; private JLabel lodgingL; private JLabel airfareL; private …

Member Avatar for ngnt4
0
114
Member Avatar for ngoelnoi

Hi, I am facing a problem in JTextPane. Actually we are creating a editor like application in Java Swing. In JtextPane we type the matter and set some metter as heading1, heading2 so on as user required and some matter as simple story. My problem is that how can we …

Member Avatar for ngoelnoi
0
104
Member Avatar for stayfierce

I am trying to run a source code that I downloaded. However, there are several error message in reference to the classes TablePanel, BufferedPanel, Stringable, and Booleanview. I am not sure why I am getting these errors because it is a complete source code. Do I need to import additional …

0
57
Member Avatar for gunjannigam

My problem statement is to draw a map from the given images whose Latitude and Longitude information is stored in database. Initial point Latitude and Longitude is given and then they will change in every 200 ms. I have to plot a map once and on top of the map …

0
64
Member Avatar for leoeroy

I'm trying make a 2 dimensional array. An array of object. I'm trying to make a 126 by 94 array of green SpotInField objects. [CODE]import javax.swing.*; class FarmField { public static void main(String[] args) { int width = 126; int length = 94; } public void FarmField(SpotInField myField[][], int dwell){ …

Member Avatar for leoeroy
0
648
Member Avatar for gasou

I need help on my project. This is what I have so far: [CODE]import javax.swing.JOptionPane; public class Convert{ public static void main(String[] args){ String choice = ""; do { choice = JOptionPane.showInputDialog(null, "Would you like to enter a temperature?"); } while(choice.equals("No") | choice.equals("no") | choice.equals("N") | choice.equals("n"));{ choice = JOptionPane.showInputDialog(null, …

Member Avatar for gasou
0
637
Member Avatar for Xav123

Hey guys im back again with a problem, i am trying to add circles to my board but i cannot do it, i am getting one error. cannot find symbol symbol : variable Col location: class SimpleDrafts g.fillOval(4 + Col*20, 4 + Row*20, 15, 15);? Anyone know the prob?? [CODE] …

Member Avatar for Xav123
0
114
Member Avatar for Stefano Mtangoo

Hi all, please help me connecting exit menu to OnExit event handler Here is what I have coded so far! Also a coding question: What is the best method between these two: 1. Creating instance of JFrame and call its methods like set Size 2. create class that extends JFrame …

Member Avatar for masijade
0
123
Member Avatar for sciwizeh

Hello all, As you may know by now, from my previous posts recently, I am working on a Paint application. My question, then, surprisingly does not involve Graphics or Swing. So my question is this: I would like to be able to have a directory such as "APP_HOME\tools" or something …

Member Avatar for sciwizeh
1
135
Member Avatar for Kreators

Hi i'm new here in daniweb i would like to ask about my program i'll make a program that show if the word is palindrome or not can you correct my program when i complie my program its say Process complete then when i run the program it doesn't show …

Member Avatar for P00dle
0
94
Member Avatar for weylinthedirty

I am writing an application for class. The user is prompted to enter a number, then select what to do what that number. I'm using JPanel and JOptionpane for input and console for output. The application is supposed to: prompt for input, ask for what to do with the input, …

Member Avatar for weylinthedirty
0
200
Member Avatar for hallinan

Hi I have a project where when you input text into a textarea if a certain word is put in I need to change this word I'm having real trouble with this Here Is what I have so far but it will not reconize some of the words [CODE]/* import …

Member Avatar for hallinan
0
91
Member Avatar for aBenjamin

this is a small example that, i hope reflects the larger project that i am working on. i am making a board game that uses a combination of mouse listener and jbutton action listener for the player to move. when it is time for the computer to take its turn, …

Member Avatar for Ezzaral
0
2K
Member Avatar for Xav123

Hey. I have been trying to do a drafts board, but i am having major problems with adding the pieces. Heres my Board. Any Suggestions?? [code] import java.awt.*; import javax.swing.*; public class Board { protected JPanel[][] squares; protected JFrame boardFrame; protected Container container; public void paint (Graphics g) { } …

Member Avatar for .11
0
101
Member Avatar for Pd123

Hey. Im having problems adding my Jmenubar to my board. It compiles fine just wont display. Any advice really appreciated. Thanks, Pd [CODE] import java.awt.*; import javax.swing.*; import javax.swing.KeyStroke; import java.awt.event.KeyEvent; import java.awt.event.ActionEvent; import java.awt.Font; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JPanel; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JTextField; import …

Member Avatar for .11
0
597
Member Avatar for gitech

Hai Friends, Iam using swing application in my project with short cut keys to perform some action, it takes few seconds to process(retrieve data from server to client) ,when i press the shortcut key for three times means the action is performing thrice, i want to perform single action.is there …

Member Avatar for gangsta1903
0
92
Member Avatar for bkafroboy69

these are all my codes and im trying to make shapoes in myshapetesrer2.these are the directions i have to follow but i dont kn ow if i did tem right any help? Write an abstract class: ColoredShape A ColoredShape has a position (x and y coordinates that are integers) and …

0
64
Member Avatar for adams161

Hi, i've started making a simple breakout game with java swing. This is just for fun and to learn more about java and swing. I got a frame and a panel and a mouse listener. I draw a paddle on the screen and it moves as the mouse moves. I …

Member Avatar for adams161
0
105
Member Avatar for tabooxchanz

Fellow Java Coders, I recently got a project to do for my coursework in university which requires that me and my group members simulate a file manager similar to windows explorer but I guess not as complex. Here is a synopsis of what is required: The members of this group …

0
61
Member Avatar for girl.java

hi how are u all this is my program [CODE]import javax.swing.*; public class Qustion2 { public static void main (String args[]){ double x =2/3; double y = (3*x*x)-(8*x)+4; JOptionPane.showMessageDialog(null,"At x= " + x +" the value is " + y); } }[/CODE] Mathematically when i substitute x =2/3 i get …

Member Avatar for donaldw
0
120
Member Avatar for Stefano Mtangoo

I'm new to Java, but will eventually want to use GUI for my Desktop applications. So as usual in any language, GUI toolkits are "debatable". In Python (My current "mother toungue") We have PyQT vs PyGTK vs wxPython and it is a good debate. I would like to hear your …

Member Avatar for Stefano Mtangoo
1
179
Member Avatar for Clawsy

Please someone help me... why image panel not showing that image in the frame: [code] //image panel class import java.awt.*; import java.awt.image.BufferedImage; import javax.swing.*; public class ImagePanel extends JPanel { private BufferedImage img; public ImagePanel(BufferedImage img) { this.img = img; Dimension size = new Dimension(500,500); setPreferredSize(size); setMinimumSize(size); setMaximumSize(size); setSize(size); setLayout(null); …

Member Avatar for Clawsy
0
205
Member Avatar for Ambislm

hi all, this s my first thread... Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 3 at calculator1$nextListener.mouseClicked(calculator1.java:1048) at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:212) at java.awt.Component.processMouseEvent(Component.java:5520) at javax.swing.JComponent.processMouseEvent(JComponent.java:3135) at java.awt.Component.processEvent(Component.java:5282) at java.awt.Container.processEvent(Container.java:1966) at java.awt.Component.dispatchEventImpl(Component.java:3984) at java.awt.Container.dispatchEventImpl(Container.java:2024) at java.awt.Component.dispatchEvent(Component.java:3819) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3901) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822) at java.awt.Container.dispatchEventImpl(Container.java:2010) at java.awt.Window.dispatchEventImpl(Window.java:1791) at java.awt.Component.dispatchEvent(Component.java:3819) at java.awt.EventQueue.dispatchEvent(EventQueue.java:463) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163) at …

Member Avatar for masijade
0
98
Member Avatar for sheehab

Hello... I try to do like this.. But I still ther are some errors...... I don't know how I solve them Could healp me.. please This is my code [CODE] import javax.swing.JApplet; import java.awt.Color; import java.awt.Graphics; import java.io.IOException; import java.io.*; import java.util.Scanner; import java.awt.*; import java.io.FileNotFoundException; public class colok__ extends …

Member Avatar for javaAddict
0
162
Member Avatar for rukshilag

I would like to know a list of systems (standalone) that can be made using JAVA. For example payroll system, billing system etc. Please state some simple systems that requires basics of OOP and few swing codes. Thank YOU :)

Member Avatar for peter_budo
0
103
Member Avatar for SORelena

I want creat thread but I dont 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 static JTextField number; //------------------------------------------------------------------------------------------------ // Constructor public MyApp() { // …

0
53
Member Avatar for eechan03

[code] import javax.swing.JOptionPane; import java.text.*; public class casestudy { public static void main(String[] args) { JOptionPane.showInputDialog(null, "Program Application", "Choose a Program", JOptionPane.QUESTION_MESSAGE, null, new Object[] { "Bubble Sorting","Balloon Sorting", "Insertion","Exit" },"casestudy"); switch(casestudy) {case 1: {String stno,ndno,rdno,thno,fthno,sthno,vthno,ethno,nthno,tthno; stno = JOptionPane.showInputDialog(null, "Input 1st number:"); ndno = JOptionPane.showInputDialog(null, "Input 2nd number:"); rdno = …

Member Avatar for javaAddict
0
98
Member Avatar for babeet

Hi, I launched my swing application.before it launched I opend a note pad.When my application got launched it is having textfiled which is blinking.but when we type something it is typed into the notepad. i need to remove the curser when the application is not having the focus. But I …

0
50
Member Avatar for rukshilag

I am a beginner to java - my university course module requires me to do an assignment - that is choose a system and build one. i have chosen "Student Grading System" - this wont require a database. i need to just enter student marks and thereby determine that subject …

Member Avatar for Ezzaral
0
107
Member Avatar for AngryOne

Hello I'm begining to learn Java and I'm trying to convert from a While loop into a for loop. Sadly I'm just not quite grasping it... I understand the loop is here [CODE]while (n * n > Math.pow(2,i)) { i++; } [/CODE] but it's not quite as simple as changing …

Member Avatar for cms271828
0
111
Member Avatar for Ecliptical210

Hi guys, so I have this project where the requirements are as follows. Create a class called Car, which serves to represent a particular vehicle at a car dealership. Consider that each car has the following properties, entered by the user (all value ranges should be error checked): Sticker price …

Member Avatar for Ecliptical210
1
146
Member Avatar for Jay V.

The program runs perfectly, however I am having an issue adding a discounted price. Another thing I noticed when I run the program is that the switch statement doesn't calculate the discounts at all. [CODE]// DiscountPrices.java - This program calculates total cost for discounted items. // Input: Interactive. // Output: …

Member Avatar for jasimp
0
3K
Member Avatar for CuteCat

I can't figure out what's wrong - I was remaking the code from an older and messier version, but now I've hit a roadblock because what I say in the actionPerformed section just doesn't happen. I suspect that it's because of the Timer, which a friend adviced me to link …

Member Avatar for javaAddict
0
202
Member Avatar for babylonlion

Hi everyone, I'm trying to write a code that converts the number that a user inputs to either Celsius or Fahrenheit simply by pressing a button. So far I was able to compile and run the program displaying the panel, buttons, and the text field but I'm not sure how …

Member Avatar for babylonlion
0
771
Member Avatar for Web_Sailor

I have got a problem with the layouts. I am creating a Grouplayout for my JLabels / Buttons etc in a window .. Then I am adding a Jtable using the JFileChooser for which I am specifying GridBagLayout and then adding the layout to Jframe again after JFilechooser creates a …

Member Avatar for Ezzaral
0
114
Member Avatar for geek_till_itMHZ

Hi Everyone... I need to convert a JFRAME to an APPLET can I do that by simply extending the JApplet Class and replacing the main method with start ? I've tried this and my program will compile but wont run Here Is the Original Code [CODE] import javax.swing.*; import java.awt.*; …

Member Avatar for Ezzaral
0
240
Member Avatar for Trogan

Hi, I am trying to get the max number from an array, but I'm not sure how to tackle it. This is what I have so far. [CODE]import javax.swing.*; public class InitArray { public static void main( String args[] ) { int array[] = { 69, 23, 47, 81, 92, …

Member Avatar for Ezzaral
1
984
Member Avatar for Ryujin89

With assistance from others, 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. The program I need assistance with reads in that file, adds a new field at the …

Member Avatar for Ryujin89
0
308
Member Avatar for buffonomics

Java has matured in terms of UI presentation. search project Aerith for examples on some of the neat things that can be done when mixing JOGL, Swing and Java2d. However, it seems these only work on windows. Mac is still strangely alienated from the Java revolution, cuz Steve still strangely …

Member Avatar for buffonomics
0
168

The End.