35,586 Topics
![]() | |
I'm writing Solitaire in java and have each column of cards set up as a 2d arraylist of JLabels, one label hads the icon and is painted to a jpanel. The other contains the url for the image as the text of the label. Below is part of the code … | |
Hi there, I'm working on a 'queue program' which will queue 30 job numbers(case 1) between 1 and 30, validated, in an array, display the array , (case 3) and remove a number from the back of the queue.(case 2) I have the display array and remove from front of … | |
Hi, I have a script to save Google Map markers in SQL. The datas from "type" and "type2" should be compared to datas in existing table "type_table" Unfortunatly the script does not save the datas. I always get the echo from "if($num_rows==0)", even if the gives datas from the formular … | |
Hey guys. I have a headache here as im new to Java. Ive tried searching, but found nothing that really helped me out. forgive a noob :) Im trying to split a string from a textfile with the following format: 0 0 0 0 0 0 0 0 0 110 … | |
this is inside my servlet: [CODE]ArrayList<String> currentCustomer = model.getAllCustomers(); req.setAttribute("currentCustomer", currentCustomer );[/CODE] how do i access this arraylist in my JSP file? I eventually wanna loop over each string element. | |
Just I am confused to choose which type of programming language for project development.... | |
Hi I wanted to know how to do this: - when the user clicks on a index in listbox from classA - the value of that index(written in classB) will go into the textbox from classC I have already written the coding for classA I just need help writting the … | |
[ICODE][/ICODE]Hi, I am trying to figure out how to start my next Inventory program part 4. What I wish to know is 1. Do I choose a New Project or choose New File? What I have been doing so far is choosing New Project. All the programs are extending from … | |
Hello, I basically have 2 GUI windows in my project. Just to explain it better, let's call the 2 GUI windows: - Window A - Window B In Window A, there is a variable that I want to change, but I have to change the value of the variable in … | |
Hi all! I am extremely new to java and to computer programming in general so I greatly appreciate all our help. Here's my problem, I am trying to write a program that reads in a basic text file with some names and some numbers, and inputs the given information into … | |
Is there a way by which I can examine how the class Class was coded? | |
[CODE]import javax.swing.*; import java.awt.*; class Calculator{ JFrame frame; JPanel panel1, panel2; JTextField textField; JButton button[]; Container contentPane; void launchFrame(){ frame = new JFrame("My Calculator"); panel1 = new JPanel(); panel2 = new JPanel(new GridLayout(4,4)); textField = new JTextField(10); button = new JButton[17]; for (int i=0; i <10; i++) button[i] = new … | |
Hello. It's been a while since I was on here. I'm writing a Java class with a generic type parameter. Among other things, it maintains an internal ArrayList of the same generic type as itself. In a perfect world, the code would go like this: [CODE=Java]import java.util.ArrayList; public class MyGenericClass<T> … | |
Hi everybody, I am planning to build a java programe named word counter. It shall have file view and help menu. A text field where user can type or paste text. A button which starts counting number of words in the text. and a text field where the total number … | |
I'm trying to improve one of my project by adding texture to a shape. The shape is oval, it basically the moon. I want it to have a realistic feel rather than gradient fill. So I look up some tutorial and this is what i got from [url]http://java.sun.com/products/java-media/jai/forDevelopers/jai1_0_1guide-unc/Graphics.doc.html[/url] [ICODE] // … | |
[code]public double bigramPMI(String bigram,String []bi) { String[] arr = bigram.split(" "); int n11 = 0, n12 = 0, n21 = 0, n22 = 0, n1p = 0, np1 = 0, n2p = 0, np2 = 0, npp = 0; double m11 = 0, PMI = 0; for (int i = … | |
I have been trying to remove two errors in this code, line 12 (non-static variable this cannot be referenced from a static context) and line 204(cannot find symbol:(method `compareTo(java.lang.Object)` import java.util.*; public class InventoryPart3 { public static void main(String[] args) { Inventory invent = new Inventory(); <---[U]non-static variable this cannot … | |
i am having this problem , i have 8 strings say ( boy,topped,pens,remotes ,boted ,toyed, car,house) but i am looking for 3 strings having substrings ending with a (ed,s,s ) for exapmle topp[COLOR="Red"]ed[/COLOR],pen[COLOR="Red"]s[/COLOR],remote[COLOR="Red"]s[/COLOR] however i have to check by first checking the first string boy and i throw it away … | |
Hi all, I am having some problem writing an ImageJ plugin for display image histogram. [CODE]import ij.ImagePlus; import ij.plugin.filter.PlugInFilter; import ij.process.ByteProcessor; import ij.process.ImageProcessor; public class Create_New_Image implements PlugInFilter { String title = null; public int setup(String arg, ImagePlus im) { title = im.getTitle(); return DOES_8G + NO_CHANGES; } public void … | |
I can turn on anti-aliasing, but whenever I draw stuff the arguments are still ints, not floats or doubles. How can I change this? | |
Well i intended to develop a sohisticated java server client program . but just couldnt push myself so far so ust had to satisfy myself with it. Well , i have created a simple chatting interface . i would not call it a chatting interface actually cuz i had something … | |
Guys, Does anyone know a redirect script that [b]leaves[/b] the referrer in Internet Explorer? [CODE]<script type="text/javascript"> <!-- window.location = "http://www.google.co.uk" //--> </script>[/CODE] The above script doesn't leave a referrer in IE (there's a surprise!)... ideally it would need to be JavaScript based because I need to make sure the user … | |
Hi! When I try to run the code [ICODE]tableModel.setQuery("select l_code, l_title, l_description from Lists");[/ICODE], then I receive the following error: [CODE] java.lang.ArrayIndexOutOfBoundsException: 0 >= 0 at java.util.Vector.elementAt(Vector.java:427) at SystClasses.QueryTableModel.getValueAt(QueryTableModel.java:72) at SystClasses.QueryTableModel.getColumnClass(QueryTableModel.java:53) at javax.swing.table.TableRowSorter.useToString(TableRowSorter.java:224) at javax.swing.DefaultRowSorter.updateUseToString(DefaultRowSorter.java:607) at javax.swing.DefaultRowSorter.sort(DefaultRowSorter.java:556) at javax.swing.DefaultRowSorter.allChanged(DefaultRowSorter.java:816) at javax.swing.DefaultRowSorter.modelStructureChanged(DefaultRowSorter.java:826) at javax.swing.JTable.tableChanged(JTable.java:4364) at javax.swing.table.AbstractTableModel.fireTableChanged(AbstractTableModel.java:280) at SystClasses.QueryTableModel.setQuery(QueryTableModel.java:110) at SystClasses.Form.createAdminTable(Form.java:747) at … | |
Hello all, is that possible to help me out with Error Checking for user input? I am developing a peg solitaire program and now need a error checking for user input or for input file. Either use try and catch.. or making another method.. can anyone give a me a … | |
I have to create all the method signatures in the ResizableArrayList and then fill it in with comments. And each method is supposed to be blank with a return null or --1. How do i do this? | |
Hey, I've gota make a program that reads characters from a text file, produces the Huffman code tree, and prints the codes for each character in the file. I've already written the code to read chars from a text file, but the Huffman code tree is the part I'm a … | |
I have to create all the method signatures in the ResizableArrayList and then fill it in with comments. And each method is supposed to be blank with a return null or --1. How do i do this? | |
Here is what I need to do: have three editable text fields labelled operand1, operator, and operand2, and a fourth read-only text field labelled result. Have a button labelled Calculate. WHen the button is clicked the appropriate operator is applied to the two operands and the resulting value placed in … | |
Hi all, I'm having a bit of a problem implementing a GUI and have no experience in multi-threaded programming. Here's the what I need to do: -Open GUI with file chooser -After user has selected 2 files, return control back to Main, along with an array of the selected files/file … | |
i want to write a a program that will accept student name and grades and output it.use an array data structure in the implementation this program and implement the following write method that will traverses the array and allow the user to perform the following processes a) search for a … |
The End.