137 Posted Topics
Re: null pointer usually means a variable is not initialized. you may do assignment but its not created with new perhaps. you have [code=java] List<UserDataRow> userDataList = readuserdatafromfile(); [/code] Do you need = new userDataList() then maybe begin assigning values from a file? I cant answer 100% cause i can't see … | |
Re: I don't know that your code has an infinite loop but you are for every number printing out a lot of 2's for each number. Depending how big your file is it could be time consuming. To see if you got an infinite loop run the code with a much … | |
I have a tabbed activity as my main class and 3 activities that it has as tabs. I've been googleing this but no luck so far. One of my activities has a thread that runs and gets messages from the telnet thread via a queue. Without going into that to … | |
Re: maybe try using a group layout [url]http://download.oracle.com/javase/tutorial/uiswing/layout/group.html[/url] you can describe the flow of how things are laid out first horizontally then vertically. The sum of these two flows are your layout. you can set the default size for your text fields. Mike | |
Re: This is code i use actually to open the browser in windows, and it seems to open notepad with a txt file on my computer. [code=java] try { Runtime rt = Runtime.getRuntime(); String[] cmd = new String[4]; cmd[0] = "cmd.exe"; cmd[1] = "/C"; cmd[2] = "start"; cmd[3] = "manifest.txt"; rt.exec(cmd); … | |
Re: Don't have the code with me but i've implemented touch support on a list. google will provide some examples. | |
Re: The c++ and particularly c# experience to me means you'll naturally pick up java as C# was really in many ways copied from java and the three languages share the same syntax. I don't know objective c, but I've thumbed through a book and it does not look like java … | |
Re: what behavior are you getting? is the icon getting inserted at all? the java page on jtextpane says about insert "Inserts an icon into the document as a replacement for the currently selected content. If there is no selection the icon is effectively inserted at the current position of the … | |
Re: not sure exactly what you are doing but after this line: "Waiting for HOME ('android.process.acore') to be launched." You have to right click on your project and do run as android application. It requires two run commands, the second one happening there. Mike | |
Re: What you do depends on if this is a stand alone or applet. if it's a stand alone i find something like this works. [code=java] URL myurl = this.getClass().getResource( "images/image1.png"); Image myimage =Toolkit.getDefaultToolkit().getImage(myurl); [/code] Also if you have an image, why not use an image rather than a buffered image. … | |
Re: I typically see a java file error out on class not found when there is no manifest file identify the class with the main method. I don't follow everything you are doing but maybe your sql code is calling a jar without a manifest. Mike | |
I have a Tabbed Activity. I extend in my main Activity TabbedActivity and create two activities that are the tabs with intents. Problem is I want the user to be able to shut down the program and i haven't figure out how to shut down the whole program. If i … | |
Re: i sometimes do something like this: [code=java] this.addKeyListener(new KeyListener() { public void keyPressed(KeyEvent e) { } public void keyTyped(KeyEvent e) {; } public void keyReleased(KeyEvent e) {; } } ); [/code] I'm wondering if it should have made you implement any other key event methods other than keypressed. If it … | |
Re: with applets i think i usuall use getCodeBase or getDocumentBase to fetch images. for example [code=java] Image myImage = getImage(getDocumentBase(), "myfile.jpg"); [/code] My understanding of this is that applets are run on web, like [url]www.mydomain.com/appletfolder[/url] and i think this tells it to start looking on the web along that file … | |
Re: seems you need [code=java] con.setVisible(true); [/code] I usually work with frames, and after creating and adding controls/layout, you have to use setVisible, but i googled container and it does inherit setVisible from java.awt.component. Mike | |
hi, I use: [code=java] fOut = thecontext.openFileOutput(filename, Context.MODE_PRIVATE); [/code] Does the private mean that unless you have the phone and are the user of the phone or otherwise got your hand on it, that no program can read the file I'm writing? I.e no installed program could request any permission … | |
Re: I don't fully understand. when you click the ok button you make a new dialog, [code=java] private void okButtonMouseMouseClicked(MouseEvent event) { //WarehouseTracer.sMessage = "Testing error message."; new TestMsgDialog().setVisible(true); [/code] | |
Re: A lot of the security with java has to do with permissions. A java applet if you accept its certificate when you go to its web page, can write to your computer, open and launch other programs. I think it can even wite to the registry. I have written to … | |
Hi, I know how to detect clicks and touches on the views, and i know how to make menus appear when they hit the menu key. My phone also has a little ball like button that you can press down on. How would an activity capture this event, say if … | |
I am writing a little android chess application, and found some chess pieces under LGPL. To use them people need to be able to modify the pieces or relink to them or a modified copy. Android lets you have a web page link and i thought i'd state the copyright … | |
Re: I don't know anything about these phones but I've been tracking CPU use in a phone drawing program, and one key thing to control is number of times you repaint the screen. also if you repaint, if possible specify the rectangle to repaint in, repaint by itself draws the whole … | |
Hi, I had to wipe a computer and reinstall the operating system and eclipse. i had backed up two of my projects in my working folder for eclipse. i copied those project folder into my new working eclipse folder, but i can't seem to open them. Open project is grayed … | |
i have a class, [code=java] class myapp // for example { // some variables used by UI and telnet class // i.e. my edit text controls and telnet object oncreate() { // initiate UI elements like 2 edittext controls and ascroller and a button // start telnet thread } class … | |
In my sample code for writing to update a value, say employeeId, i saw it said to use the properties method and follow two paths. If it exists allready: [code=c#] If(child.Properties.Contains("employeeId")) [\code] then you would simply do: [code=c#] child.Properties["EmployeeID"][0] = Id; // by the way it seems this has two … | |
I use almost every day, [url]http://www.mibbit.com[/url] It's a web client for IRC. It has one real nice feature. when i type, if i misspell a word, it sort of writes a line through the word, and i can right click for spelling suggestions. I think actually it might be my … | |
Re: maybe add some try catch logic. if it cant be converted your try will fail. then write 0. if it is converted then write your if condition in the try, if value is greater than other value and write the number or 0. so 3 paths it can take. here … | |
Re: [code=c#] class Test { static void Main() { double x = 1234.7; int a; // Cast double to int. a = (int)x; System.Console.WriteLine(a); } } // Output: 1234 [/code] from: [url]http://msdn.microsoft.com/en-us/library/ms173105.aspx[/url] | |
I can use vb.net or c# on this part of the project and i was hoping someone could tell me a little about updating an active directory field. i found in searching system.directoryServices in google this bit of vb code. user.Properties("title")(0) = employeeTitle.SelectedItem.Text which i think is this in c# … | |
Re: Just looking at lines, say drawing a line, its an interesting question the way you phrased it. I've done some drawing in c#, wrote a connect 4 program, and had to draw my grid were you drop the pieces and of course drew colored circles to indicate the chips you … | |
i found this code to update a property on an active directory entry: [code] If user.Properties.Contains("title") Then user.Properties("title")(0) = employeeTitle.SelectedItem.Text Else user.Properties("title").Add(employeeTitle.SelectedItem.Text) End If [/code] I understand it except for the ("title)(0). why is this a double index array. what does the (0) do? Mike | |
Re: if you have [code] class mainclass{ stuff mystuff; open myopen; mainclass() { mystuff = new stuff(); myopen = new open(mystuff);// we pass a copy of mystuff, its an object so passed by reference. } class stuff { int a; int b; int c; stuff() { a=b=c=5; } }//end stuff } … | |
Re: 'd be interested how to do it too. sounds like he wants a global save from all games on all computers the total dots. saving to a cookie would be local. | |
Hi, i got a jeditor pane working to display web links in my program. normal web pages display fine, and I got a hyperlink listener and that is working so they can click links. I use setPage("url as string");. what I'm noticing is if the page has pictures on it, … | |
Re: when i make a frame i do this [code] JFrame aframe = new JFrame(); aframe.setVisible(true); [/code] every time you make something its invisible tell you set its visible property. Mike edit woops missed that jamescherrill had that | |
Re: you dont use a main method in an applet you have: [code] public static void main(String[] args) [/code] replace it with [code] public void init() [/code] your class also needs to extends JApplet. since you cant extend JFrame and JApplet both in one class, maybe make the Applet the outer … | |
Re: It sounds like atomic age has the best answer but another generic way to handle this sort of things, is simply use the String methods, for example in this case Replace, to replace any $s or ,s in a string with "". this is the function definition from mdsn: [code] … | |
hi, I'm having a bit of a problem. I"m simply trying to read active directory now with system.directoryservices. I have a LDAP path i think its called and i get the children and for each child i for each through and so on for like 5 for each loops. OK … | |
Hi, I have a list of a few thousand names. I actually have last name, first name, phone number, etc and more info. I'm going to make a class to contain the data. so I'll have like a people object with for example a last name field. I'm going to … | |
Re: one method I've seen for inter process communication is pipes. found this link for pipes in .net ( didn't check language now that i think of it c# or vb) [url]http://www.switchonthecode.com/tutorials/dotnet-35-adds-named-pipes-support[/url] a typical way I've seen pipes work is one program communicates through standard input / output like a console … | |
Re: a recursive function is a function that calls itself. for example: function zoneClear(square as integer) 'check each of 8 surrounding squares. '3 possibilities. one its eligible to clear. two its already clear, 3 it has a bomb. 'do this 8 times 'calculate square + some number to get one up … | |
Re: this is a little confusing. this thread , except for the last two posts by mukeshbca2 is from 2004. Did you find it in a google search? Mike | |
I have visual studio 6 and want to make a mfc dialogue application that is allays on top. By this i mean whatever programs you have open it will allays be on top. It's window will be fairly small so it doesn't get in the way. the reason for always … | |
Re: you have this public void paint(Graphics g) { super.paint(g); if (draw) { g.drawLine(0, 0, 1000, 1000); } else { } } }; i'm not as familiar with writing methods in the define of the panel like your doing, but if you created a panel class, this is what you'd do … | |
I have a java applet and i'm letting the user open a chess engine on their computer. Technically they can open any program now. but it wont work unless its a chess engine that uses the winboard protocol. My question is could they maliciously choose to open any sort of … | |
Re: I googled what i think is the page for that documment you can get: [url]http://java.sun.com/j2se/1.4.2/docs/api/org/w3c/dom/Document.html[/url] org.w3c.dom Interface Document it says: The Document interface represents the entire HTML or XML document. Conceptually, it is the root of the document tree, and provides the primary access to the document's data. and has … | |
hi, I had a while loop in a run method, and in the while loop were a series of if stements. the series of if statments were in a try. my hope was if any if statement conked out it would catch the error, and continue the while loop ( … | |
Hi, i'm displaying gifs on the screen that i draw on there, and i resize them depending on window size. The problem is as the board gets bigger, they get jagged. I recall from another thread, ( that i cant find) that there is a way to sort of make … | |
Re: try this web link and read the comments at top: [url]http://java.sun.com/j2se/1.4.2/docs/api/java/util/GregorianCalendar.html[/url] essentially as it says: This implementation handles a single discontinuity, which corresponds by default to the date the Gregorian calendar was instituted (October 15, 1582 in some countries, later in others). The cutover date may be changed by the … | |
i've written a game board currently but its minimal. i draw the board and then i've added two labels that i've postiioned off to the right side with setlocation. I dont know that set location will work as i add more controls so i'm looking for a better way. currently … | |
hi, i have an array of JTextPane's. console 0 uses array[0] jtextpane to see their chat. console 1 uses array[1] jtextpane etc. up to them how many jtextpanes they use/consoles they create/open. they can move different chat channels to different consoles or have all channels go to one. lets say … |
The End.