32,204 Topics

Member Avatar for
Member Avatar for bobytch

Hello everyone in this activity i should use if, else if, Boolean, for loop, do while loop ok here is the OUTPUT i must do: GRADING SYSTEM! 96-100 =1.00 94-95 =1.25 92-93 =1.50 90-91 =1.75 88-89 =2.00 86-87 =2.25 84-85 =2.50 82-83 =2.75 80-81 =3.00 78-79 =3.25 75-77 =3.50 74-below …

Member Avatar for CSloan7597
0
189
Member Avatar for Alviery

Can anybody help mi getting the area so that I display it on a message? Here is the driver: import javax.swing.JOptionPane; public class Driver { public static void main(String[] args) { Rectangle tennisCourt = new Rectangle(); { JOptionPane.showInputDialog(null," Enter Lenght: " + tennisCourt.setLength() ); JOptionPane.showInputDialog(null," Enter Lenght: " + tennisCourt.setWidth() …

Member Avatar for stultuske
0
119
Member Avatar for jeraldmuthu

[CODE] public List<SelectItem> getAnalysisList() throws ProjectContentServiceException { selectItems1.clear(); if (getTreeTable() != null && this.rootTreeNode != null) { this.rootTreeNode.accept(new TreeNodeVisitor() { public void visit(TreeTableNode node) { TreeTableUserObject obj = node.getUserObject(); if (obj.isLeaf()) { List<String> aa = new ArrayList<String>(); Map<String, Object> attributes = obj.getAttributes(); if (attributes.containsKey("selected") && ((Boolean)attributes.get("selected")) == Boolean.TRUE) { lis …

0
86
Member Avatar for pmehalik46

hi everyone. i am writing a small caeser cipher program in java for a lab is my cs class. I am sure that most of it is generally okay, but when i run the program it will not return the newly encrypted or decrypted code. Why??? is there something wong …

Member Avatar for JamesCherrill
0
728
Member Avatar for vvsjon

Google don't crawl my javascript link.. [CODE] <td><span>1</span></td><td><a href="javascript:__doPostBack('grdCompany','Page$2')">2</a> ........ [/CODE] How i crawl these link in Google??

Member Avatar for hericles
0
103
Member Avatar for tr4nquility

I would like to build a simple highlighter program. The idea is to set an image to change the cursor so that it will look like a highlighter. And then, when we move the cursor, it will trace a line along with our movement. The requirement here is to be …

Member Avatar for tr4nquility
0
904
Member Avatar for chiiqui

I have installed MySql here already, now i need to connec it because I am going to make a project which it needs a Database, but my problem is that I don't know how to set the connector/j/ I don't know how to install it/I don't know how to put …

Member Avatar for peter_budo
0
95
Member Avatar for Alviery

How do I set a new salary and a new department for the emp1 object class using a setPosition method. Everything works except that for some reason I just can't show the results on Message. Here is the Driver: import javax.swing.JOptionPane; public class Employee { public static void main(String[] args) …

Member Avatar for thines01
0
99
Member Avatar for poojavb

Hello All, I need to create a java code for auto numbering. A value will be mentioned in a table in database eg 10000. The java file has to retrive the database value and start the auto numbering from that particular number. It should increment by 1 for the next …

Member Avatar for poojavb
0
394
Member Avatar for java.util

I have this try-block [CODE]try { FileReader textFileReader = new FileReader(filename); BufferedReader textReader = new BufferedReader(textFileReader); String post = textReader.readLine(); int weeknumber = Integer.valueOf(post); if (weeknumber != weeknmbr) { System.out.println("Wrong weeknumber."); return false; } post = textReader.readLine(); while (post != null) { insertPost(post); post = textReader.readLine(); } textReader.close(); }[/CODE] but …

Member Avatar for java.util
0
112
Member Avatar for jaxi

I'm working on a simple encryption/ decryption program for class. When I try to compile, I get a number of "expected areas" directed towards the following segment of code: [code] public static char encrypt(char c, String k) { String fullcrypt = (k + "abcdefghijklmnopqrstuvwxyz"); for (int i = 0; i …

Member Avatar for jaxi
0
181
Member Avatar for umsungun

[code]import java.util.*; import javax.swing.JOptionPane; import java.text.*; class playGames{ public static void main (String [] args){ Fermi fermi; fermi = new Fermi(); int num1 =fermi.fermi1(); int num2 = fermi.fermi2(); int num3 = fermi.fermi3(); boolean playGame = true; int firstGuess; int secondGuess; int thirdGuess; String inputStr; inputStr = JOptionPane.showInputDialog(null, "Enter the First …

Member Avatar for NormR1
0
194
Member Avatar for maurya10

Filename is "htb.java". Here is the code:- import java.io.*; import java.util.*; import java.lang.*; public class htb{ public static void main(String[] args) throws Exception{ File f= new File("dyna.txt"); BufferedReader in = new BufferedReader(new FileReader(f)); String[] line = new String[40000]; line[0] = in.readLine(); int i=0; while(line!=null) line[++i] = in.readLine(); String[] mem_add=new String[100000]; …

Member Avatar for NormR1
0
236
Member Avatar for nsyncpilu

Hy , I am using netbeans to create an app. I wanted to eliminate the windows buttons (minimize , maximize , exit) so i could have full control on the exit button , and i used setUndecorated(true) in the PuppetApp.java (main app that netbeans creates). Now i created a exit …

Member Avatar for NormR1
0
966
Member Avatar for nchy13

here, there are two functions in branchpredictor class namely predictor and trainer. [B]what i have pointed out is that predictor is working fine but trainer is not updating the variables of the above class. is it that only first function can access the variables. [/B] if not, can any one …

Member Avatar for JamesCherrill
0
168
Member Avatar for javausers

Hi, I m writing code to map single key(Integer) with array of values. But, its not giving the correct output. Here is the code: [CODE]import java.io.*; import java.util.*; class MapDemo{ public static void main(String args[]){ TreeMap<Integer, Object[]> tMap = new TreeMap<Integer, Object[]>(); Object[] vals = {"tree", "map", "sorted"}; tMap.put(1, vals); …

Member Avatar for JamesCherrill
0
106
Member Avatar for th3b3n

the following code is used to get the contents of an excel document and pint it to console - will eventually filter and write a new excel file, but that will come later. [CODE]/** * */ import java.io.*; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import javax.swing.*; import java.awt.*; import java.awt.event.*; …

Member Avatar for th3b3n
0
206
Member Avatar for thechicken

hi, im trying to create a program that records the amount of times a number was rolled using input from the user. currently it is only printing 1 number and i need it to print 6. i am only beginning to study java so im lacking knowledge a bit. any …

Member Avatar for WolfShield
0
109
Member Avatar for danielagaba

hi I came up with this code to help me convert a string into an integer array but i keep getting a null exception when i run it and i am not sure how to fix it. [CODE] import java.io.*; import java.lang.reflect.Array; public class test { static String message; static …

Member Avatar for JamesCherrill
0
323
Member Avatar for th3b3n

Hi all, I'm new to java programming but finding it rather fun and interesting. Right now I have [CODE]for(String name : chkNms) { JCheckBox checkBox = new JCheckBox(name); checkBox.setMnemonic(KeyEvent.VK_C); checkBox.setSelected(false); // checkBox.setActionCommand(name); add(checkBox); checkBox.addActionListener(this); }[/CODE] to create all the check boxes I need, roughly 30 or so. The last line …

Member Avatar for th3b3n
0
225
Member Avatar for AliALghamdi

Hello guys, I've been trying to make a program that takes the IDs from a file and make them into a 1D array. The input file looks like this : 201053420 201052456 201488540 201384345 And it should be working even if there's more than 4 IDs. [CODE] import java.util.*; import …

Member Avatar for NormR1
0
148
Member Avatar for nered

Hi, [CODE] package guiInt; import java.awt.*; import javax.swing.*; import javax.swing.tree.*; public class Init { public Init() { } void buildFrame() { JFrame window = new JFrame(); window.setTitle("Pos Setup Tool 0.1 Alfa"); window.setSize(800, 600); window.setResizable(false); JPanel sidebar = new JPanel(new GridBagLayout()); sidebar.setPreferredSize(new Dimension(250, 600)); sidebar.setBackground(Color.black); JTree tree = buildTree(); JScrollPane sidebar_placement …

Member Avatar for nered
1
133
Member Avatar for SoniaC

This is the instruction: Mrs. Rogers, the owner of "Jus' Right supermarket", has asked your consulting firm to design a program for a simple cash register system which will allow the cashiers at the shop to total the price of the items being bought by a customer, calculate the tax …

Member Avatar for JamesCherrill
0
164
Member Avatar for persianprez

So I have this small program that draws circles of different colors depending on "velocity" Below is my code, btw I haven't actually implemented velocity yet. When I run it, I get these"[CODE]Exception in thread "AWT-EventQueue-1" java.lang.NullPointerException at Mouse.paintComponent(Mouse.java:35) at javax.swing.JComponent.paint(Unknown Source) at javax.swing.JComponent.paintChildren(Unknown Source) at javax.swing.JComponent.paint(Unknown Source) at javax.swing.JComponent.paintChildren(Unknown …

Member Avatar for JamesCherrill
0
127
Member Avatar for danielagaba

hi i'm having some trouble with objectinputstream. i wanted to know if it is possible to validate whether the contents are string or integers then i also wanted to ask how i could convert the contents to int []. For the latter i tried converting it to char [] first …

Member Avatar for stevanity
0
122
Member Avatar for asif49

I have two strings like so: [CODE] String a = "on matt to"; String b = "onomatopoeia"; [/CODE] I've been trying to do... [CODE] if (a.contains(b)) return true; [/CODE] It returns true in this case since the character sequence "mat" matches the "ono[B]mat[/B]opoeia". I want it to return true only …

Member Avatar for ~s.o.s~
0
149
Member Avatar for innspiron

Hello programmers, can anyone tell me how to add or set alternative name for certificate to the keystore? I am trying to create web service client using netbeans and when it trying to get wsdl description from site it gives me: java.security.cert.certificateexception no subject alternative names present Site is under …

Member Avatar for innspiron
0
768
Member Avatar for dark_sider_1

Hi there, I usually feel really bad posting a whole bunch of code, but might any of you have an idea of why I'm getting an output of 105553 for 55555*66666? I'm supposed to use the A La Russe algorithm for multiplication: n*m m if n = 1 (n/2)*2m if …

Member Avatar for NormR1
0
186
Member Avatar for besjana

Please can you help me to solve an exercise in Java ? Here is the exercise : Create e program in Java that shows an image in a panel. The program let the user to make 2 clicks repeated ( make first click and immediately make the second click. ) …

Member Avatar for zeroliken
0
184
Member Avatar for nchy13

i actually learned java only a day ago and we have to submit assignment after two days. i wanted to figure out what i did here with class and function definition is correct. if correct can you help me out with the compilation error. in fact all are similar. it …

Member Avatar for nchy13
0
347

The End.