35,618 Topics

Member Avatar for
Member Avatar for jones13

After trying different things for about a week i have come to the conclusion i am lost. Can someone please show me how to do this. This assignment, based on Vending Machine we did in class, you are to now vend six different snacks. The Vending Machine has a capacity …

Member Avatar for JamesCherrill
0
405
Member Avatar for moaz.amin.37

import java.io.*; class WriteFile { public static void main(String ss[]) { try { FileWriter fw=new FileWriter("output.txt"); PrintWriter pw=new PrintWriter(fw); String s1="Hello World"; String s2="I Am Learning Java"; pw.println(s1); pw.println(s2); pw.flush(); pw.close(); fw.close(); } catch(IOException e) { System.out.println(e); } } } in upper code println() is called with object of `PrintWriter` …

Member Avatar for moaz.amin.37
0
197
Member Avatar for ife_1
Member Avatar for rubberman
0
110
Member Avatar for reuben_1

I have this big problem with my code, here it is: https://www.dropbox.com/s/2lc6iygbx2gwlqj/Screenshot%202014-07-19%2011.24.20.png here is my ERROR: Exception in thread "Thread-0" java.lang.IllegalArgumentException: input == null! at javax.imageio.ImageIO.read(ImageIO.java:1348) at ca.gingerninja.game.gfx.SpriteSheet.<init>(SpriteSheet.java:19) at ca.gingerninja.game.Game.Screen(Game.java:55) at ca.gingerninja.game.Game.run(Game.java:78) at java.lang.Thread.run(Thread.java:745) Can someone please help, I would really like to continue with my game!

Member Avatar for JamesCherrill
0
3K
Member Avatar for Doogledude123

I am honestly baffled that there is almost NO help for anyone using JavaFX. For those of you who know Java like the Face on a clock, I encourage you to take some time to learn Java FX. The beginners need people like you.

1
129
Member Avatar for hwoarang69

Hi, I am using Java, Libgdx, box2d I main class I have created a body and I set player x and y position to 50. // main class public class main{ ... private void createPlayer() { BodyDef bdef = new BodyDef(); Body body; FixtureDef fdef = new FixtureDef(); PolygonShape shape …

Member Avatar for Taywin
0
372
Member Avatar for Violet_82

hi all, I wanted to build a small and easy interface where I have some text and two buttons, one to increase the size of the text and one to decrease it. I haven't built anything as yet, I am still thinking what's the best way to go. In terms …

Member Avatar for Violet_82
0
417
Member Avatar for moaz.amin.37

Exception message is not showing import java.util.*; class WrongException extends Exception{ public WrongException(String s){ super(s); } } public class UserDefinedException2{ public static void main(String s[]){ int a,b; a=b=0; Scanner ob=new Scanner(System.in); System.out.print("Enter your age = "); a=ob.nextInt(); try { if(a<=0) throw new WrongException("age cannot be zero or nagetive"); System.out.print("age = …

Member Avatar for Akansha Jain
0
2K
Member Avatar for razor2890

I have the following field in a jsp page.. <select size="1" name="typ"> <option value="C">Coffe</option> <option value="T">Tea</option> &nbsp; </select> Now when the user selects Coffeand and clicks submit, I want the page to go to Coffe.jsp and when Tea is selected , i want it to go to Tea.jsp I tried …

Member Avatar for trhtrh
0
6K
Member Avatar for Doogledude123

I have a method that sets the width and height of the treeview to its parent's width and height, for some reason this isn't working. I had it working with a listview, but I decided a treeview would work best in my case. Ill supply the full FXML, and it's …

Member Avatar for Doogledude123
0
2K
Member Avatar for Doogledude123

How would you "lock" the position of a SplitPane Divider in JFX? I've tried google-ing around, and all I can find is ways to make it Transparent, which I believe would still make it movable... Any Ideas?

Member Avatar for Doogledude123
0
263
Member Avatar for Doogledude123

I cannot get the JFrame to display my JPanel. Either that, or my JPanel isn't displaying my JScrollPane. Here's my code: public class PokeBase extends JFrame { private static final long serialVersionUID = 1L; private static final int WIDTH = 1280; private static final int HEIGHT = 720; public static …

Member Avatar for Doogledude123
0
352
Member Avatar for adarshcu

Hi All, I need some help with analysing a problem. I have a list of objects that are retreived as part of search results in my webapp page. From the list of these objects, one object is selected and the next screen is populated with the data from this object. …

Member Avatar for JamesCherrill
0
153
Member Avatar for brittney_2

I want to know if I would be able to replace different words all in one regex expression. For example if I wanted to replace the name John with Joe and Smith with Doe. Would I be able to do that with one expression? Here is a code that I …

Member Avatar for ~s.o.s~
0
748
Member Avatar for Mike Askew

Quite rare to see me post in the Java forum but have been picking it up as part of a long-distance university course I am doing. I am currently trying to read in an ASCII coded .txt file and output it but am seeing some funny characters showing up. The …

Member Avatar for JamesCherrill
0
174
Member Avatar for s.zangeneh

I'm having a problem with making .js files for my javascript project using visual studio2013. Where should i save made file to make it work with my project?

Member Avatar for iConqueror
0
122
Member Avatar for IndieDeV2002

I have been developing a simple java game, however I would like to add some Music to my game because it seems quite boring whenever you play it.

Member Avatar for bCubed
0
930
Member Avatar for Slavi

Me as one of the users in Dani web and a person who has interest in Java, I've tried to solve if not all, most of the begginers problems. I've even tried to solve some myself afterwards however, now I ran out of ideas. I would also like to move …

Member Avatar for JamesCherrill
0
498
Member Avatar for 2384443

well guys, i wanted to try somethng fun in java, so i made a simple form type navigation program.. i can compile this file, bt i cant run it..NOTE: i have no issues in my java software.. import javax.swing.*; import java.awt.event.*; import java.awt.*; import java.util.regex.*; public class Nav2 extends JFrame …

Member Avatar for 2384443
0
246
Member Avatar for RAJboss

function generateHashLink($service_domain, $file_path, $url_signing_key ,$expiry_timestamp = NULL){ // + and / are some of represented chars of based64 encoding (8 bits) // + is 62 and / is 63 and these char should be replaced by other predefined chars $search_chars = array('+','/'); $replace_chars = array('-', '_'); if($file_path[0] != '/'){ $file_path …

Member Avatar for peter_budo
0
299
Member Avatar for Doogledude123

My girlfriend, as confused as she is when I talk about programming, wants me to program her something. She's away on vacation to Australia right now. Of course, I told her I would program something for her in time for when she gets back. But the part that I'm stuck …

Member Avatar for kb.net
0
191
Member Avatar for xxwikkixx

I am trying to send some strings on my android device using bluetooth to my arduino so I am wondering if my logic is correct for my code. The part I am stuck on how to implement if all arguements are OK then it should send String temp = "t"; …

Member Avatar for Taywin
0
258
Member Avatar for funnym3

Hi guys, I'm new here and I have a activity in my java class. my instructor want to sort all the given names after they added to the list. can you guys help me with it? thanks here's my code: import java.util.*; public class Test{ public static void main (String …

Member Avatar for funnym3
0
133
Member Avatar for Violet_82

Hi all, I started to look into event handlers, and there is something I would like to ask, sorry if this is a silly one. I can see that different Java components generate different events when the user interacts with them, but when it comes down to 1)which interface the …

Member Avatar for Violet_82
0
307
Member Avatar for anand01

Hi all, I have employee class which I have 100 variables with getters and setters. now I am passing employee object to processing method. Now I want to read all values in processing method. Should I want to use getter for all member? Is there any way to achieve this. …

Member Avatar for JamesCherrill
0
290
Member Avatar for sunil.sahu.14203
Member Avatar for reuben_1

Hi there, I would like to make a basic plugin with a /hello command that when types outputs "Hello, user!" or there minecraft user name I have done all the code, and I have a problem of which the server says: [16:02:10 ERROR]: Could not load 'plugins/GreetingsPlugin.jar' in folder 'plugins' …

Member Avatar for stultuske
0
93
Member Avatar for Richa_2

interface Data { public void load(); } abstract class Info { public abstract void load(); } public class Employee extends Info implements Data { public void load (){ System.out.println ("loading"); /*do something*/ } } Why this code is correct ? Is it is not compulsory to deine the method declared …

Member Avatar for stultuske
0
333
Member Avatar for dwel
Member Avatar for chdboy

This is the code void CreateGUI() { try { //myPicture = ImageIO.read(new File("Companylogo_FINAL.jpg")); myPicture = ImageIO.read(new File("Companylogo_FINAL.jpg")); //myPicture = ImageIO.read(getClass().getResource("Companylogo_FINAL.jpg")); /*java.net.URL u = getClass().getResource("/resources/Companylogo_FINAL.jpg"); System.out.println(u); myPicture = ImageIO.read(u);*/ /*try {*/ //myPicture = ImageIO.read(new File("Companylogo_FINAL.jpg")); /*} catch (IOException e) { }*/ ImageIcon img = new ImageIcon(myPicture); //frame.setIconImage(img.getImage()); } catch (IOException e1) …

Member Avatar for chdboy
0
481

The End.