32,204 Topics

Member Avatar for
Member Avatar for soniajothi

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 …

Member Avatar for dononelson
0
425
Member Avatar for lovelyRose

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 …

Member Avatar for dononelson
-1
166
Member Avatar for TheWhite

[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) …

Member Avatar for TheWhite
0
220
Member Avatar for Taimoor Rana

Hello guys, I was wondering is it possible to set an animated Background to a JPanel instead of a simple colored background?

Member Avatar for paycity
0
1K
Member Avatar for coding101

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]

0
63
Member Avatar for apanimesh061

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

Member Avatar for ddanbe
0
89
Member Avatar for mg120

I am trying to seperate JTextArea colums as you can see on the pic. How can i do that any idea ?

Member Avatar for mKorbel
0
70
Member Avatar for jalpesh_007

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 …

0
87
Member Avatar for Crapz

We already tried setWeight but it seems that it doesn't work, do we have to SET_DEFAULT_EDGE_WEIGHT = 1.0?

Member Avatar for mKorbel
0
58
Member Avatar for Bladtman242

[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 …

Member Avatar for Bladtman242
0
227
Member Avatar for Limiter

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 …

Member Avatar for Limiter
0
2K
Member Avatar for ekin5683

[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() { …

Member Avatar for mKorbel
0
433
Member Avatar for Crapz

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.

Member Avatar for Crapz
0
86
Member Avatar for hc++

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 …

0
40
Member Avatar for Thendi

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 …

Member Avatar for Thendi
0
650
Member Avatar for desert564

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"; …

Member Avatar for dononelson
0
107
Member Avatar for virus.exe

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; …

Member Avatar for kekkaishi
0
187
Member Avatar for techie929

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.

0
52
Member Avatar for sariberri

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 …

Member Avatar for Ezzaral
0
291
Member Avatar for Taimoor Rana

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. …

Member Avatar for Taimoor Rana
0
139
Member Avatar for Sadun89

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? :-/

Member Avatar for masijade
0
215
Member Avatar for joseph.roy9

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

Member Avatar for Ezzaral
0
62
Member Avatar for sumprit

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.

Member Avatar for sumprit
0
189
Member Avatar for Jaydenn

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 …

Member Avatar for javaAddict
0
87
Member Avatar for kiswah03

when i click on my jar folder,nothing happens, i also tried opening by using command prompt .no use plsss help me

Member Avatar for kiswah03
0
108
Member Avatar for jitsux

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 …

Member Avatar for abhishek20
0
164
Member Avatar for bhattpratik

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]:)

Member Avatar for bhattpratik
0
2K
Member Avatar for Cassandra Low

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 …

Member Avatar for mKorbel
0
150
Member Avatar for rampapz

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 …

Member Avatar for javaAddict
0
224
Member Avatar for alliance

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 …

Member Avatar for audiomatic
0
305

The End.