32,204 Topics
| |
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 … | |
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() … | |
[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 … | |
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 … | |
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?? | |
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 … | |
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 … | |
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) … | |
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 … | |
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 … | |
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 … | |
[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 … | |
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]; … | |
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 … | |
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 … | |
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); … | |
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.*; … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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. ) … | |
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 … |
The End.