35,618 Topics
![]() | |
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 … | |
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` … | |
![]() | |
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! | |
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. | |
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 … | |
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 … | |
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 = … | |
I have the following field in a jsp page.. <select size="1" name="typ"> <option value="C">Coffe</option> <option value="T">Tea</option> </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 … | |
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 … | |
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? | |
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 … | |
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. … | |
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 … | |
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 … | |
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? | |
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. | |
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 … | |
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 … | |
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 … | |
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 … | |
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"; … | |
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 … | |
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 … | |
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. … | |
| |
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' … | |
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 … | |
I want to learn Java completely but how to start in basic to advance Helps needed | |
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) … |
The End.