32,204 Topics
| |
Question Create a class named Package with data fields for weight in ounces (oz.), shipping method, and shipping cost. The shipping method is a character: ‘A’ for air, ‘T’ for truck, or ‘M’ for mail. The package class contains a constructor that requires arguments for weight and shipping method. The … | |
write a driver program with a main method to read in data for five pets and dispaly the following data: name of smallest pet, name of largest pet, name of oldest pet, average weight of the five pet, and average age of the five pet. also, test to see the … | |
[CODE] import java.util.regex.Matcher; import java.util.regex.Pattern; public class test_regex { public static void main(String[] args) { String text = "(asdf) (123) (zxcv)"; Pattern p = Pattern.compile("^\\((\\S+)\\) \\((\\S+)\\) \\((\\S+)\\)$"); Matcher m = p.matcher(text); if (m.matches()) for (int i=0; i<m.groupCount(); i++) System.out.println(i+".) "+m.group(i)); else System.out.println("no match"); } } [/CODE] [QUOTE] Output: 0.) (asdf) … | |
Hello guys, I was wondering is it possible to set an animated Background to a JPanel instead of a simple colored background? | |
Can someone help me print my BST in level order. Heres what i got so far... [CODE] Queue<BinaryNode<Type>> f=null; while(node.element!=null){ System.out.println(node.element); if(node.left!=null){ f.offer(node.left); } if(node.right!=null){ f.offer(node.right); } if(!f.isEmpty()){ node=f.remove(); } else{ node.element=null; } } [/CODE] | |
Most people at my college say that Java is easier than C#. Is it true ? On the internet mostly I see are Java apps. !!! Could anyone anyone tell me that what are the applications of C#, 'cause I am planning to a project on this language. Thanx | |
I am trying to seperate JTextArea colums as you can see on the pic. How can i do that any idea ? | |
i have created following program for bipartite graph. But i need little help from you. I have to calculate objective function using Integer Linear programming(ILP). I have create complete bipartite graph.From which at a time from one node only one outgoing edge from member of set-1 and only one incoming … | |
We already tried setWeight but it seems that it doesn't work, do we have to SET_DEFAULT_EDGE_WEIGHT = 1.0? | |
[B]TL;DR:[/B] I am asking for help considering the structure on the following code, and advice on code structure in general. The problem in this case is the try blocks, which are messing up the scopes and complicating error handling. I will elaborate a little for the more patient readers below … | |
A very small problem I am having. Here is an example: A class representing a book [CODE] public class Book { private String title, author; //Constructor for book public Book (String name, String writer) { title = name; author = writer; } [/CODE] Another class called Bookshelf representing a collection … | |
[CODE]mport java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import javax.swing.*; import java.awt.*; import javax.swing.ImageIcon; import javax.swing.JApplet; import javax.swing.JButton; public class Main extends JApplet implements ActionListener,ItemListener { //private Image im; // image handler //private static final String IMAGE = "enviro2.jpg"; //starFish tapakSulaiman = new starFish(this); public void init() { … | |
We have no idea how to start our project regarding Minimum Spanning Tree (Kruskal) we have to implement it on java, i would like to ask what are the useful functions for MST under jgrapht or jgraph? thank you. | |
Hello there, I am trying to make an applet that would let the user move a dot around a bounding circle. (The dot has to move along the circle's boundary, see the attached example image) I am having trouble updating the dot's position, because the bounding circle gets erased while … | |
Hi I am trying to put quicksort in my class like other methods and call it using the main method, I did it for Selection, Insertion, Bubble Sort and I need one more which is quicksort. I already made the calling code for quicksort but I don't know how to … | |
any time a number is present in a word inflate its value by 1........ for eg, input anyone up four tennis output anytwo up five elevennis [CODE]import java.io.*; public class inflationary { public void main()throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String num[]=new String[14]; num[0]="zero"; num[1]="one"; num[2]="two"; num[3]="three"; num[4]="four"; num[5]="five"; … | |
Hey im having trouble making the tester part of a program. In the first part I made a class named student: [CODE]public class Student { private String name; private int idnumber; private double gpa; private int credithours; public Student(String studentname, int idNumber, double gradepa, int chours) { name = studentname; … | |
Hi, I have a sample.rgb video file and I can view this video file using Java code. This sample.rgb has total 1800 frames. The video is displaying really slowly. Is there any way I can increase the frame per second?? Thanks. | |
I need to add a border around the Size label and the small, medium and large buttons so I thought I would add them into their own Panel and then add that panel to the mainPanel but when I do that they do not show up. What am I doing … | |
hey guys, I drew many lines for the purpose of my project but for some reason, I cannot draw this specific line[U](code line 44)[/U] and cannot figure out why. Note: I have debugged the code and this code line is red by Java but it's not applied to the graphic. … | |
In java,Java compiler java source code convert to java byte code..... Than Interpreter execute codes line by line.... what is the languages java compiler & Interpreter have bailed up? :-/ | |
hi, i want to develop a java swing application for searching names in the database; how can i get names which starts with a particular aplaphabet; ex.'j' ans:joseph john etc........ plz help me thanks in advance | |
Hi, i need to find the max value of ArrayList<ArrayList>. I don't know whether it is possible or not? Can anyone please give me some suggestion. Any help from you will highly be appreciated.... Thanks. | |
My entire project is fucked if I can't do this; Basically, I need to be able to add an element to a JList (doesn't need to be a JList, just needs to be a list component) then have a tag added to the element too, so when I get the … | |
when i click on my jar folder,nothing happens, i also tried opening by using command prompt .no use plsss help me | |
I need help. I have a project that I have to hand in within 3 days. My mind goes blank everytime I read the requirements, This is the question: You are required to create 15 random strings. The user should then be asked whether he wants these strings sorted in … | |
Hello! I want to know exactly What Is [COLOR="Green"]Difference[/COLOR] Between The [COLOR="Red"]FileFilter[/COLOR] and [COLOR="Red"]FileNameFilter[/COLOR] in java.io.*; Do they both work the same ? Please answer ....... [B]-> {Pratik Bhatt}[/B]:) | |
Hi, I'm currently trying to store all the text in text area into a txt file in directories using java. I know how 2 use mkdirs() to create directories, for example C:/d1/d2, but if i type [CODE](new File(C:/d1/d2/sample.txt)).mkdirs()[/CODE] it makes the txt file into a folder too. I tried with … | |
Hi, I need help on the complete coding of Java mug. This is an given to me by the university, I have just started my course on java. So, could please someone help me & provide me the complete coding on java mug. This would help me to score good … | |
In a certain sports league, a group of teams plays through a Schedule of Game. At the end of this Schedule, they want to determine the winner. To determine the winner, you will have to determine for each team how many Games they won, lost, and tied. Assuming 2 points … |
The End.