- Strength to Increase Rep
- +7
- Strength to Decrease Rep
- -1
- Upvotes Received
- 14
- Posts with Upvotes
- 13
- Upvoting Members
- 11
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
137 Posted Topics
Re: [QUOTE=smachee;1072044]I have written the code for the following problem and would just like some feedback before I move on. The problem states: Here is my code: Does this seem to meet the requirements? Thanks for your help![/QUOTE] Doesnt look like you met the requirements at all. in your while look … | |
Hi, I'm considering writing a java applet that has a chess board and lets people solve puzzles. There are chess engines that are free that could be the AI to play against and they come in executable files (console apps) compiled for both Mac and Windows. Now i have a … ![]() | |
Re: i have beginning and pro android and find them handy ( not sure if i have 1 or 2 version). You'll ultimately do a lot of web searching for specifics, but to have a framework, the books were useful. They are readable, short chapters, but assume a knowledge of java … | |
![]() | Re: maybe i need to see more code but i dont see why you are creating your JButton in a method that returns a JButton. private JButton getBtnSave() { wouldnt you create the button in the panel constructor or intialize components? and what is this if(btnSave == null) { it has … |
Re: this is the API you can use with strings. [url]http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html[/url] you can use all those methods. if your not clear enough on the page how to use a given method but you can tell its the one you want, googl it like google String equals() java Mike | |
Re: I had a conversation with a friend maybe eight years ago and this topic came up. He had worked with schizophrenic people as a social worker, something he did for a bit in his twenties. I think he was like a floor staff person at some time of shelter or … | |
Re: I had not done this exactly but decided to try. I have an objective-c class for a program, dataparsing.m/h. I placed in it's .h file at the very bottom, below @end void printInCOut(char *p); At the tomp of the .m file above the @implementation line but below the import lines, … | |
Re: You need enough focus to work on it for over an hour at a time. Ideally after maybe some intital play 2 or 3 hours in a session. The way to start is download the java sdk that sdk software developer kit from Sun. current version is 1.6.* i believe. … | |
Re: Realy it's kind of a mis question. You don't develope iphone or ipad apps on the ipad. Apple hasn't made that tool. You need to use XCode which is a free program for macs. XCode allows development for both ios and native mac apps. This does bring up an issue … | |
Re: Everyone wants to do the smart thing here. If i can run one html 5 page and not develop for different mobile platforms, why not. My own company is facing this decision and i think they are going to try html 5. My main gripe is i think the app … | |
Re: I have given up on taking android seriously and i started in android mobily about 2 years ago. I've developed 2 android apps. But to me the clean IOS world is worth it. But it does bring up a point. One of my android apps was a beta i did … | |
I've been tinkering around with my first IOS project that basically is a chat client right now. It connects to a server and lets you read chat and send chat. I want to next let the user isolate some chat in another page on the story board. They might choose … | |
Re: You can jar it. lets say you had a program with package free. that means you have a free folder and inside it your class files. I'd navigate to the folder that contains the free folder, and type jar cvfm jarnameichoose.jar manifest.txt free manifest.txt is a file you create that … | |
I have a Java application i've written, it's a chess client that i've done as a hobby project, and it has a main applicatoin window and all the windows are contained in that. I've had a number of requests from mac users that they'd like to see it converted to … | |
Re: YOU might get an exception if the url is bad. [url]http://localhost/[/url], not sure where that goes. try [url]http://www.google.com[/url]. that's usually what i use for initial testing. Mike | |
Hi, On windows, i don't see a maximum button on my JDialogs and this is fine, but on a Mac I have this dialog that people can keep up and use other windows, but you can also maximize a dialog on a mac apparently. There is a maximum button. At … | |
Re: typically if you want the applet to open in its own window, within the applets init method you create a JFrame, you give it a size or you maximize it and you set it visible, then write your code in the frame class and its panel. within the paintComponents method … | |
At present i have a folder lantern with files lantern/*.class or java also in lantern are graphics folders. lantern/img with files /lantern/img/image1.gif for example The folder lantern folder is in is called build and its in my class path. each file in lantern/*.java has package lantern; i type java lantern/multiframe … | |
Hi, I have a frame and it contains some different JInternal frames. I have a request that some people want some of these frames to be free floating, and not confined within a desktop. Is there any way to do this with JInternal frames? Or is there any way to … | |
I have found out a program similar to mine, a chess interface, named jin, jinchess.com, deploys on mac as an SDI program. This means all the windows are free floating and i think the menu is detached. Any idea how this is done? the same program deploys under windows as … | |
Re: i usually see it as [code=java] System.out.println(); [/code] You do [code=java] out.println(); [/code] Interesting it doesn't error. I guess its legal but perhaps the deviance is why you see nothing. Mike | |
Re: A little confusing for me. I would create one master panel for the JFrame and add it to frame. From then on i would add additional panels to the master panel. I would give the master panel some layout maybe border layout. I would add one panel to the center … | |
Re: you can implement a mouse motion listener: [url]http://download.oracle.com/javase/tutorial/uiswing/events/mousemotionlistener.html[/url] and in on the mouse movement method track x,y to a variable to use in your paint components. you can implement a mouse listener to detect clicks [url]http://download.oracle.com/javase/tutorial/uiswing/events/mouselistener.html[/url] on a click write the current x,y as motion has updated it to writableX … | |
Re: you have these 4 lines: [code=java] pn1 = new JPanel(); pn2 = new JPanel(); pn3 = new JPanel(); pn4 = new JPanel(); [/code] but i see 8 panels or up to pn8. 4 are null so maybe that is the null pointer exception. I really hate to see variables like … | |
Re: someone with a similar issue. maybe this is helpful [url]http://www.daniweb.com/forums/thread126923.html[/url] mike | |
Re: That's the kind of thing easily picked up from reading the first few chapters of a basic introductory java text book. but on the web, the oracle page on constructors is: [url]http://download.oracle.com/javase/tutorial/java/javaOO/constructors.html[/url] and variables is [url]http://download.oracle.com/javase/tutorial/java/nutsandbolts/variables.html[/url] oracles tutorial pages are very good for info on tons of java topics. Mike | |
hi, I have the line of code: [code=vb.net] xlWorkBook = xlApp.Workbooks.Open("c:\mydocs\full_info.xlsm") [/code] my problem is i want to load the file without a full path, "full_info.xlsm", but i can't seem to find the right place to put it. i have the program name directory which contains folder 'bin' 'myproject' 'obj' … | |
Re: That looks like your constructor. I usually don't use public in front of a constructor but i don't see that it should hurt. Maybe it's the notion that you can't have a constructor with an argument ( int) without having a default constructor with no arguments, even if you don't … ![]() | |
I'm a little self taught at java. I have a package: package: package org.newdawn.spaceinvaders there's folders like org and newdawn are created and nested. the main is Game.java at end of those folders. How do i run it? i went to the end folder and typed java Game that didn't … | |
I figured out how to make indentation with [code=java] SimpleAttributeSet style = new SimpleAttributeSet();// = doc.addStyle(null, null); StyleConstants.setLeftIndent(style, 12); StyleConstants.setFirstLineIndent(style, -12); [/code] and then use doc.setParagraphAttributes(doc.getLength(), 1, style, false); after the insert into document. now numbers there doc.getLenght(), 1, i've been changing around but always same issue. The problem is … | |
Re: try setFont method maybe. I googled JListBox and came up with JList and it said on that page Methods inherited from class javax.swing.JComponent and setFont was one. When dealing with a lot of java controls you often have to read those long lists of methods that are inherited to get … | |
Re: you have [code=java] double outsideTemperature, windSpeed; double velocity = Math.pow(windSpeed, 0.16); [/code] windspeed is declared and on the next line it's used to calculate velocity, but in declaring it, you didn't assign it any value, i.e. int a =5; would be a declaration and assignment at same time. I would … | |
Re: i just have in my manifest file: Main-Class: multiframe Be sure to hit enter after that line. multiframe.java contains my main class. Mike | |
Re: you have: [code=java] String.replaceAll("<(.|\n)*?>",""); [/code] Not sure why you are using String here in the static sense. If i had [code=java] String mystring = readFile(); // now string is populated. // proper use of replaceall below mystring=mystring.replaceAll("<(.|\n)*?>",""); [/code] see you want to call mystring.replaceAll , so it knows which string … | |
![]() | Re: JInternalFrame should be internal to some parent frame. typically after creating an internal frame you have something like, [code=java] desktop = new JDesktopPane(); // create jinternalframe called say myIFrame desktop.add(myIFrame) [/code] take a look at this link [url]http://download.oracle.com/javase/tutorial/uiswing/components/internalframe.html[/url] Mike |
Re: Sounds like you will need a keyboard listener and your frame ( which should have a panel) will need a paintComponents method to draw to the screen images or shapes. I think things work best when you do all your work in the panel, so attach the keyboard listener to … | |
Re: It also says at the end of your errors, ProjectTwo.java:46: reached end of file while parsing } → :) This typically means you dont have your open { and closing } matching. sure enough you dont. you close the while loop } but not the method paint. need another } … | |
Re: what error do you get? i see sample code on the web where something like this is done, [code=java] Comparator<Integer> r = Collections.reverseOrder(); [/code] you just feed your sort method Collections.reverseOrder(). Do you need to defined the actual object like in my code snippet above, to tell it number is … | |
Re: Your for loop starts count at 0 and says it must be less than 1 so it loops once and count is always 0. next iteration count is 1 and it wont loop as count is not less than 1. edit -added not the expression: [code=java] dimensions[count][count][count] [/code] is read … | |
Re: i would say merge your second row loop with the third double loop that prints the values. i.e. when you go to print your firt row of values, before the first print , print the row number, then print each value. ie..e if values are 3 9 12 15, print … | |
Re: So start writing code and let us know if you get stuck on anything specific. Best of luck :) Mike | |
Re: Two things come to mind. One is you are doing a lot in onCreate. This runs before the UI is created. Maybe move the database code into a thread, ( and bear in mind that thread will have to create a handler to update the ui like that textview), that … | |
Re: Hi, Maybe one approach is to split this into two parts. First detecting clicks, then if you identify they click on a url, ( you will know what they click on and maybe you look if it starts with www. or [url]http://www[/url].), open the url in your listener that heard … | |
Re: not sure what this line is doing: [code=java] int blank = input.indexOf(' '+1); [/code] You are using '' + 1 as an argument to indexOf. if you are trying to find the index of ' ', i think you want just indexOf(' '); then do blank++; maybe on next line … | |
Re: While silence is sometimes said to say a lot, in your case silence leaves one wondering, what is the question? Mike | |
Re: Your while loop seems to require [code=java] columnStart+a>columnEnd && rowStart+a>rowEnd [/code] columnStart and rowStart are smaller numbers than the end, which is 5 i think, and a is 0 , so it would never execute the while loop, if i have enough information to make that conclusion. Mike | |
Re: in your original code it was: [code=java] public void print() { print(head); } private void print(Unit unit){ if(unit==null) return; System.out.println(unit.info); print(unit.next); } [/code] // edit fixed code tag what this does is let a user use the print method that is public then it calls the private method with a … | |
Re: yea not enough info need to track the line throwing the exception and exactly what is the stack trace. but i did find this code [code=java] String url = "jdbc:derby:Fred"; Connection con = DriverManager.getConnection(url, "Fernanda", "J8"); [/code] this is getConnection using a log in name of Fernanda and a password … | |
Re: I'm guessing its the manifest. lots out there if you google bunde-activator. saw this: Bundle-Activator: class-name where class-name is a fully qualified Java classname maybe your name isn't quite doing it with package.classname you have. Mike | |
Re: this code isnt really good: [code=java] # # do { # System.out.print ("How many integers would you like to enter? "); # try { # n = sc.nextInt(); // stores the next integer typed by the user in n using Scanner sc # } # catch (InputMismatchException e) { System.out.println("This … |
The End.