3,978 Topics

Member Avatar for
Member Avatar for techxaidz

So i have this assignment, > Create a quiz game that displays, in turn five questions about any topic of your choice. All five questions should have the same three possible multiple-choice answers. For example, you might ask trivia question about Australia states for which the correct response is Victoria, …

Member Avatar for stultuske
0
335
Member Avatar for phil.sutton

I am new to Java, and I have been trying to get an assignment coded and keep gettin java.lang.NullPointerException in Main Class.java:39. Ok, no prob. Unfortunately I can't quite get this fixed. Any suggestions? I'm using Eclipse Juno. Also, any suggestions on any books, sites, etc that review java in …

Member Avatar for NormR1
0
325
Member Avatar for joshuamichael0808

Hello everyone, I'm new here, and reletively terrible at coding, so I was hoping I could get some assistance with a program I've been working on. My assignment is to create a Frame that allows the user to choose where to paint a circle using a horizontal and vertical scroll …

Member Avatar for JamesCherrill
0
186
Member Avatar for Viped

Hi, how is it possible to handle multiple keys at same time. I am making platformer game. Now if I push forward it goes forward until I release button or hit some else button example jump. What should I do to achieve that it wouldnt stop going forward but jumps …

Member Avatar for Viped
0
179
Member Avatar for suncica2222

I'm using Netbeans 7, JEE project with application client, stateless ejb with remote interface, and JPA entity clasess made from sql script. Interfaces are in separate library project which is referenced in ejb and client project. **And the problem is the remote method that use custom interface object made from …

0
190
Member Avatar for Hemanth.Satkuri

Hi, I have a file uploaded in DB. Can i download it from Swing application. By Download I mean with options like Open,Save,Cancel and set the response type based on the file's extension. Thanks in Adv. :)

Member Avatar for NormR1
0
253
Member Avatar for abders

The GUIFlowLayout is giving me some trouble, the GUIFrame works fine. I have copied this from the Java programming book which I am using (Introduction to JAVA, eight edition, by Y. Daniel Liang). I get red error lines under 'setLayout', all of the 'add' words, and all the 'setTitle, setSize' …

Member Avatar for abders
1
291
Member Avatar for TheHealer

Trying to change the size of the shapes over time. Making them bigger as they move upwards and to the right, and making them smaller as they move downwards and to the left. This is the class that contains the move method: import java.awt.*; import javax.swing.*; import java.util.Random; public class …

Member Avatar for NormR1
0
1K
Member Avatar for triumphost

I had absolutely no clue where to post this but I figured since it crashes on the C++ side, I'd ask here. I have the following code: Java side (Loads My C++ DLL just fine.. Passes it a ByteBuffer so that I can write to that): import java.io.IOException; import java.awt.*; …

Member Avatar for triumphost
0
400
Member Avatar for jaydac12

HI ! could you please help me here? i'm having a problem on marking the books in my library program if it is borrowed or returned? here's where im at, import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.*; import java.awt.Color; public class Library { ArrayList<String> bookName = new ArrayList<String>(); {{ …

Member Avatar for jaydac12
0
706
Member Avatar for Dizzy Noob

hello everyone, Ive been trying to alter strings and i am having a very difficult time altering the vlaue after i split them. i understand what i am doing when i split the input(String[] word = phrase.split(" ");), thanks to this site.. and how i am then able to alter …

Member Avatar for Dizzy Noob
0
282
Member Avatar for Techboy52

//Hey I need some help //Write a JAVA application that displays a traffic light (three circles inside a rectangle with //red, yellow, and green color) and three buttons with red, yellow and green titles. The //application should turn the appropriate light on when the appropriate button is clicked. Two //lights …

Member Avatar for JamesCherrill
0
2K
Member Avatar for stlcards007

I need help with the if else statement below. I am trying to use branching to determine and drawString to find the longest lines between the points. Everything I try with the branching method seems to give me errors so I have no idea what to do and it is …

Member Avatar for JamesCherrill
0
160
Member Avatar for Hemanth.Satkuri

I have a Date Picker code. Can you help me in constructing the Time Picker . Or can you suggest me some websites/materials to refer Thx in Advance

Member Avatar for NormR1
0
128
Member Avatar for Kunal Lakhani

I have created an application using swing. On clicking a particular menu item, a form is loaded,and after saving it a pdf generates. For reporting, i am using iReport. Here is the code snippet MyiReportViewer.java package sms.ui.ireport; import java.awt.BorderLayout; import java.awt.Container; import java.io.InputStream; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import …

Member Avatar for Taywin
0
316
Member Avatar for Alsobhi

Hello I'm new learner in java, and I'm facing a problem to develop a Java application that will ask the user for the time in terms of hour and minutes and display the time by drawing a clock. I have created two classes, and the code is below. Please could …

Member Avatar for NormR1
0
502
Member Avatar for Hemanth.Satkuri

Hi, I have created a table with first column as checkbox. Using the below Code.. TableColumn tc = constructedTable.getColumnModel().getColumn(0); tc.setCellEditor(constructedTable.getDefaultEditor(Boolean.class)); tc.setCellRenderer(constructedTable.getDefaultRenderer(Boolean.class)); tc.setHeaderRenderer(new CheckBoxHeader(new MyItemListener())); I sometimes get stackoverflow exception. Is This beacause of the above code..?

Member Avatar for JamesCherrill
0
185
Member Avatar for bruizer

import javax.swing.*; import java.awt.*; import java.text.*; import java.awt.event.*; public class SchoolApplet8 extends JApplet implements ActionListener { double userAmount; double userInterest; double userTerm; int month = 0; double remainBalance = 0; double interestPayment = 0; double principalPaid = 0; JPanel row1; JLabel lblAmount; JTextField txtAmount; JLabel lblInterest; JTextField txtInterest; JLabel lblTerm; …

Member Avatar for NormR1
0
285
Member Avatar for Hemanth.Satkuri

Hi , Is it possible to have loaders in Swing. By Loaders i mean, showing a loader image with masking on the application till the data is retrieved from DB and displayed in TextArea. Just like we have ajax loaders Not allowing to access other screens in the application with …

Member Avatar for dmanw100
0
130
Member Avatar for abhishek_s_n

My application has two parts; a server and multiple clients. This project has its implementation both on Windows(Swing) and Android. The Server sends a song which a client receives and starts playing; more like we watch videos on YouTube; streaming. Sending data in chunks and receiving the same is accomplished. …

0
133
Member Avatar for Neversleepin

Hi, i have a JComboBox in a small java program. if i see the properties of the JComboBox i can see SelectedIndex = -1 SelectedItem = null But i can't the name of each item and i have 5 items normally. Where can i see them in the properties? Thank …

Member Avatar for NormR1
0
139
Member Avatar for fmasroor

import java.awt.*; 02 import javax.swing.*; 03 import java.util.Random; 04 import java.awt.event.*; 05 import java.awt.Color; 06 import java.awt.Graphics; 07 public class actualstuff extends JFrame 08 { 09 private JTextField textField1; 10 public static int index=0; 11 public static Graphics gx; 12 public actualstuff() 13 { 14 Container container=getContentPane(); 15 container.setLayout(new FlowLayout()); …

Member Avatar for piyush09
0
176
Member Avatar for iash

i m trying to do a music cd databse. i done most of it bt i dont kno how to do the search methord..can any 1 help this is my program import javax.swing.*; import java.util.ArrayList; import java.io.*; import java.io.IOException; public class Cd { public String ArtistName; public String CdName; public …

Member Avatar for JamesCherrill
0
112
Member Avatar for cisumma

Hello I am using Apache derby embedded database: I have been using a system to display records from the database described in "DisplayInstructorAvailableNowJTable.java". it allows the result set to create a model from a prepared statement. I have only uncovered the tip of the iceberg concerning JTABLE. I am not …

0
139
Member Avatar for Dev.Waleed

Hey there! I am a new student that wants to be a GOAT of Developing, I don't know anything about Java. But by watching I downloaded Eclipse IDE for Java Developers but don't know how does it work :D I have also downloaded Java Program or Files from http://www.java.com/ Can …

Member Avatar for stultuske
0
236
Member Avatar for hemanth.balaji

I am getting the following exception when I am running my Swing Application. But the program continues and does not terminate abruptly unlike general Exceptions Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at javax.swing.plaf.basic.BasicTreeUI.paintRow(BasicTreeUI.java:1399) at javax.swing.plaf.basic.BasicTreeUI.paint(BasicTreeUI.java:1189) at javax.swing.plaf.ComponentUI.update(ComponentUI.java:142) at javax.swing.JComponent.paintComponent(JComponent.java:742) at javax.swing.JComponent.paint(JComponent.java:1005) at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4963) at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4916) at javax.swing.JComponent._paintImmediately(JComponent.java:4859) at javax.swing.JComponent.paintImmediately(JComponent.java:4666) at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:451) …

Member Avatar for JamesCherrill
0
759
Member Avatar for ctclements

import java.io.File; import java.util.Scanner; import javax.swing.JFileChooser; import javax.swing.JOptionPane; import javax.swing.UIManager; public class TextAnalysis { public static void main(String[] args) throws Exception { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); JFileChooser chooser = new JFileChooser("c:/users/zachary/demo"); int outcome = chooser.showOpenDialog(null); if (outcome == JFileChooser.APPROVE_OPTION) { File f = chooser.getSelectedFile(); Scanner words = new Scanner(f); String word = JOptionPane.showInputDialog("Enter …

Member Avatar for Majestics
0
2K
Member Avatar for HankReardon

How do you write an input validation loop that compares strings? My attempt at the code is included. Thank You, Hank Question 4.6. Write an input validation loop that asks the user to enter “Yes” or “No”. import javax.swing.JOptionPane; import java.text.DecimalFormat; import java.util.Scanner; /** CIS-151, Input Validation Loop */ public …

Member Avatar for WDrago
0
1K
Member Avatar for Hemanth.Satkuri

FIRST: String str = queryTextArea.getText(); final JTextArea textArea = new JTextArea(); textArea.setFont(new Font("Sans-Serif", Font.PLAIN, 12)); textArea.setText(str); textArea.setCaretPosition(0); JScrollPane scrollPane = new JScrollPane(textArea); scrollPane.setPreferredSize(new Dimension(350, 150)); int res = JOptionPane.showConfirmDialog(null,scrollPane,"Query", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE); System.out.println( "showInputDialog: " + res ); if(res==0) queryTextArea.setText(textArea.getText()); Using this I'm unable to resize the document-modal SECOND: String str …

Member Avatar for NormR1
0
722
Member Avatar for iEpic

I'ma noob and need some help from the pros. For school I gotta make a program to convert numbers into roman numerals 1-10 and return an error if its not 1-10. Got it all pretty much figured out but I want to know how to have it where if someone …

Member Avatar for JamesCherrill
0
218
Member Avatar for trishtren

Hello, iv looked around google and have found it is possible to put an applet into a jframe. The problem i am having is that my applet is to be hosted online, what i want is to take the applet that is online and display it from a swing or …

Member Avatar for NormR1
0
229
Member Avatar for Babyblues

Ok so here is what I have and I am stuck. It is not recognizing whether a number is even or odd. So where do I need to put the remainder operator so that it will recognize if a number is even or odd? import javax.swing.JOptionPane; // program uses JOptionPane …

Member Avatar for stultuske
0
206
Member Avatar for sassy14udd

I have been a member here for awhile altho I have not been online in some time. Now, I'm trying to get back into the swing of things again. I am self taught as far as the code I know with intensions of going back to school as soon as …

0
109
Member Avatar for gurusubramaniam

Hi.. I want redirect a frame into next frame. In swing method how to redirect a frame into next frame ?

Member Avatar for stultuske
0
137
Member Avatar for I_m_rude

The publicity team for Technozion is in full swing. Like every year, this time too, the team is planning to visit N different colleges in India. This publicity campaign shall involve the members of the team giving presentations about Technozion. For the publicity trip, the team has decided to come …

Member Avatar for I_m_rude
0
280
Member Avatar for dantheman4

package cs1410; import javax.swing.*; public class P2 { public static void main(String []args) { drawDiamond(); } public static void drawDiamond() { int x,y,z; int a=1; String out="\n"; int i=Integer.parseInt(JOptionPane.showInputDialog("Enter your size")); if((i%2)!=0) { int in=(i/2)+(i%2); int bb=in-1; int b=bb+(bb-1); for(x=in;x>0;x--) { for(y=x;y>1;y--) out+=" "; for(z=0;z<a;z++) out+="*"; a+=2; out+="\n"; } for(x=0;x<in-1;x++) …

Member Avatar for JamesCherrill
0
240
Member Avatar for gimmeuheart

/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package buttontest; import java.awt.*; import java.awt.event.*; import javax.swing.*; /** * * @author noorulrafiedza */ public class ButtonTest extends JFrame { private JButton Button , Button1,b; private JPanel Group; private JCheckBox cek1; …

Member Avatar for harinath_2007
0
1K
Member Avatar for vinnitro

This is my program for Biodata in applet using JFrame import javax.swing.*; import java.awt.*; public class Biodata extends JFrame { JLabel jlname,jladd,jlmobno,jldob,jlgender,jltab,jlhob,jllang; JTextField jtname,jtmobno; JTextArea jtadd; JComboBox jcd,jcm,jcy; JRadioButton jrm,jrf; ButtonGroup bg; JTable jtedu; JScrollPane jsp,jshob; JList jlhobby; JCheckBox jc1,jc2,jc3; JButton jb1,jb2; JPanel jpr,jpcombo,jpcheck; JFrame jf; Biodata() { jf=new JFrame("Biodata"); …

Member Avatar for vinnitro
0
1K
Member Avatar for AngelOfRock

Hi guys, i'm trying to program a simple Tic-Tac-Toe game with extern Buttons. When i'm compiling the Code there's no mistake, when i press Button1 every thing ok, but on the most other Buttons a mistake is shown up : Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at grafik.Zeichenfenster.farbeAufloesen(Zeichenfenster.java:330) at grafik.Zeichenfenster.zeichnen(Zeichenfenster.java:276) at …

Member Avatar for JamesCherrill
0
816
Member Avatar for admiralis

Hi I am new in this forum. I need some help with this code and is for my intro to programming class. I did it following a pseudocode I found in other website but I am totally confused now. It is not working. Do nothing. Thanks This is the assigment …

Member Avatar for admiralis
0
277
Member Avatar for dantheman4

Hi I am just starting to learn about java.I am trying to calculate BMI of an individual using the JOptionPane.showInputDialog method who I am asking to enter 4 things first name,last name,height in inches and weight in pounds. I want to show the BMI using JOptionPane.showMessageDialog method showing their full …

Member Avatar for NormR1
0
1K
Member Avatar for ihiroshi30

hi my name is hiroshi.. im new with java programming.. my prof gave us an assignment to make a calendar.. i don't know what to do.. my head going crazy i dont know what is wrong with my code.. please help me T_T your big help is much appreciated.. import …

Member Avatar for JamesCherrill
0
244
Member Avatar for pocix

i need help with building the controller by using MVC pattern view 1 import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; public class BankView { JFrame frame; JPanel one, two; BankSaving saving = new BankSaving(); BankCurrent current = new BankCurrent(); BankView(){ frame = new JFrame(); one = new JPanel(); JButton b1 = …

Member Avatar for pocix
0
457
Member Avatar for eirene08

**this is the code!** import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.RenderingHints; import java.awt.Shape; import java.awt.font.FontRenderContext; import java.awt.font.GlyphVector; import java.awt.geom.AffineTransform; import java.awt.geom.Point2D; import javax.swing.JFrame; import javax.swing.JPanel; public class Clock extends JPanel{ public void paint (Graphics g) { Graphics2D g2d = (Graphics2D) g; g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); String s = "12 1 2 …

Member Avatar for Taywin
0
579
Member Avatar for kraykezia

hi, i need to display dfferant images in a single label . here is the coding, import javax.swing.ImageIcon; if (ALBtbl1.getSelectedRow() == 0) { picLbl1.setIcon(new ImageIcon("C:\\Documents and Settings\\kezia\\Desktop\\TMK.JPEG")); the problem is that the image does not get displayed in the label. please i need solution urgently. thanks

Member Avatar for JamesCherrill
0
120
Member Avatar for john.mcdonnell.777

I have this code and I have been trying to figure it out for a while now but i cant get it to work .My basicproblem is I cant get the paint part or the programme to work properly. I have done several paint programmes in the past but i …

Member Avatar for JamesCherrill
0
248
Member Avatar for boxofsnacks

import java.awt.*; import java.text.NumberFormat; import java.util.Locale; import javax.swing.*; public class SalesFigures { public static void main (String[]args) { float prod1 = 0, prod2 = 0, prod3 = 0; float prod4 = 0, prod5 = 0; String inputString; int prodId = 1; // Need user input to determine outcome while (prodId …

Member Avatar for NormR1
0
437
Member Avatar for dragonofspam

Hello, I am trying to write a program that will calculate the volume of a hole to be dug for a pool or spa. I have some radio buttons that the use can select. Once a button is chosem, the user enters information and then can hit the calculate button …

Member Avatar for dragonofspam
0
3K
Member Avatar for 47pirates

Hello guys i trying to manage the size of two jpanel according to the size of Main Jframe. I using netbeans drag and drop Jpanel1 is big and another one is small. wat i need to do is to change those panels size when main frame is resized> how can …

Member Avatar for JamesCherrill
0
199
Member Avatar for heenakashyap

I am trying to resize the widths of the columns in a JTable. I would need to resize them when the program is running to see the full column header names. I want to resize table of database showing in swing frame. I have tried table.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS) But i dont get …

Member Avatar for heenakashyap
0
164

The End.