32,204 Topics

Member Avatar for
Member Avatar for Ephron

hi, I've got a really long String of bits, like: "0010101011101010011011011010100110101010110101..." And I want to chop it into pieces of eight and make bytes out of them, in an array. what would be a performant way to do this? Thanks Ephron

Member Avatar for Ephron
0
213
Member Avatar for coco24

I have this code and it works. It prints out the number, product, and sum, but I need it to be able to work with more than one number. For example if enter 45 6 70 I need it to say Numbers: 45 6 70 Sum: 121 Product: 18900 How …

Member Avatar for Onlineshade
0
151
Member Avatar for Bladtman242

Right, I wasn't sure whether to put this here or in the java forum (since I'm trying this in java) but in the end I figured it is probably a general coding question. Hope I got it right :) So, about object names :) I'm trying to do the c++ …

Member Avatar for Bladtman242
0
191
Member Avatar for dwayned

Hi, I have created a small appication to run a number of self extracting archives depending on the option selected. I have the program working and all is going to plan. At the moment my program calls the slef extracting zip by pointing to the location on the hard drive …

Member Avatar for dwayned
0
230
Member Avatar for binoman

I just try to calculate 5.3 - 5, and the answer is a bit off. this is the code: [CODE]double answer = 5.3 - 5; println("answer = " + answer);[/CODE] and the output is: "answer = 0.2999999999999998" instead of 0.3. I use Eclipse on win 7 32 bit as a …

Member Avatar for binoman
0
1K
Member Avatar for konradhoppe

Hi community, I have a problem with an application which makes use of a mysql database. I have a class which saves the fields of every record on the table. One of the columns is of type Datetime. Sometimes (!) I query this column and get results like with a …

Member Avatar for ywang
0
342
Member Avatar for karyal

hi every body! i set the Layout to be null [CODE]setLayout(null);[/CODE]. when i resize the window, components do not resize. if there any code that i can write to solve my problem? please help!

Member Avatar for karyal
0
109
Member Avatar for vishal1949

I am supposed to make a charstack program that has to run an error. This is the Question: [COLOR="Red"]Add explicit error reporting for stack underflow via a checked exception (i.e., one that must be declared and caught). Provide a main program that tests this new capability.[/COLOR] I don't what the …

Member Avatar for JeffGrigg
0
447
Member Avatar for baby_c

Hi friends,I got a problem down here.. Ok here's part of my First GUI code. all I want to do is locate the[ICODE]labelImage[/ICODE] on the bottom half of the [ICODE]panel[/ICODE].. any idea..? I tried the following steps.but it didn't help Set the container's layout manager to null by calling setLayout(null). …

Member Avatar for baby_c
0
187
Member Avatar for hfx642

I would like my JSpinner to show up as having a Layout of GridLayout (3, 1), with; Panel.add (JTextField); Panel.add (Up_JButton); Panel.add (Down_JButton); and all 3 (contained) GUI components to be the same size. Is this possible? if (so) How? (My work around is to build it myself, which I'm …

Member Avatar for mKorbel
0
143
Member Avatar for warlord902

I have a requirement that my java application should open a web browser when user click on a button and thereafter the web browser open up a page in which user have two options "Agree" and "Not Agree", depending on the button he clicks on, some code comes in the …

Member Avatar for warlord902
0
416
Member Avatar for BobTheLob

Hey, I have a potentially very stupid question. I'm working on a project where I need to input a few numbers. What I would like to do is run it via the command line like, "java test 2 3", where 2 and 3 would be the inputs. I want to …

Member Avatar for Ezzaral
0
120
Member Avatar for MasterOfNothing

We have a problem similar to [URL="http://forums.techguy.org/all-other-software/947576-solved-java-applets-only-working.html"]this[/URL] Clean boot doesn't help and the unchecking of services doesn't help ether. We have a Java applet that's working correctly on xp but isn't working correctly on win 7. The applet runs and the browser asks you to accept the certifiket but the …

Member Avatar for MasterOfNothing
0
323
Member Avatar for superjj

Hi This is a code for placing a few labels. Now, I have a problem with my grid. I want the 0,0 point in the upper left corner but at the moment it is around the middle. Can someone help me please? [CODE]import javax.swing.*; import java.awt.*; public class test { …

Member Avatar for superjj
0
168
Member Avatar for akasekaihime

hello everyone! I need help....a prof asked for our help to create a simple program for her assignment but i am having a hard time doing it for I am still not an expert in java.....here is the scenario..... [QUOTE]You are about to go to the Super market and would …

Member Avatar for NormR1
0
178
Member Avatar for Ensanvoration

Here is what I have so far... [code]import java.util.Scanner; public class tst { public static void main (String [] args) { Scanner stdIn = new Scanner(System.in); String sentence = "This is the test."; char response; // user's y/n response int ctr = 65; do { System.out.print ("Would you like to …

Member Avatar for Ensanvoration
0
152
Member Avatar for Pravinrasal

i create small application in struts but it give me following error : SEVERE: Servlet.service() for servlet jsp threw exception java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491) at org.apache.struts.util.MessageResources.<clinit>(MessageResources.java:57) at org.apache.struts.taglib.html.FormTag.<clinit>(FormTag.java:93) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.Class.newInstance0(Class.java:355) at java.lang.Class.newInstance(Class.java:308) at org.apache.jasper.runtime.TagHandlerPool.get(TagHandlerPool.java:126) at org.apache.jsp.Index_jsp._jspx_meth_html_005fform_005f0(Index_jsp.java:109) at org.apache.jsp.Index_jsp._jspService(Index_jsp.java:87) at …

0
115
Member Avatar for janice91

Dear experts, i need your kind assistance of the following question: Build a simple banking simulation around the BankAcct class. Require to write a program to act as the "Bank", which provides the following services: a. Create new account. A new account will be created, with a unique bank account …

Member Avatar for JamesCherrill
0
198
Member Avatar for aldeene

anyone have a link? I want to display data on the GUI that I made using NETBEANS.. I started learning java today, I got error non-static variable jTextField1 cannot be referenced from a static context. [CODE]Connection con = DriverManager.getConnection("jdbc:mysql://localhost/sample", "", ""); Statement stmt = (Statement) con.createStatement(); String select = "SELECT …

Member Avatar for JamesCherrill
0
125
Member Avatar for newbie14

Dear All, I got an application which have many sql select statement and some are done withing the outler select statement. The problem is that sometimes I get this error com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after statement closed.? What could be the cause is it because I am using the statements …

Member Avatar for JamesCherrill
0
153
Member Avatar for aldeene

why this code is not working?, error: non-static variable jTextField1 cannot be referenced from a static context [CODE]try{ Connection con = DriverManager.getConnection("jdbc:mysql://localhost/sample", "", ""); Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery("SELECT name FROM testtable"); while (rs.next()){ String n = rs.getString("name"); jTextField1.setText(n); } stmt.close(); con.close(); }catch(Exception e){ [/CODE]

Member Avatar for aldeene
0
137
Member Avatar for Anuradha Mandal
Member Avatar for baby_c

:( Sorry the topic spelled incorrectly.. I can't edit it noe.. sorry for that Friends again need you so badly.. I'm developing my simple GIS application, actually here's what I developed so far.. [CODE] import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import javax.swing.BoxLayout; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; …

Member Avatar for baby_c
0
250
Member Avatar for vishal1949

I want to find the average score of a LinkedList. My code is [CODE]/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package bowlinggame; import java.util.LinkedList; import java.util.TreeSet; public class BowlingGame { public static void main(String[] args) { TreeSet <String>PlayerNames …

Member Avatar for singh_soorma94
1
1K
Member Avatar for caswimmer2011

Hello, I got a MacBook Pro for college and i'm trying to program on it. It's all good except when i use the robot class, i don't see any key codes or key events for keys such as function, option, and command. Can i use those keys when using the …

Member Avatar for harinath_2007
0
3K
Member Avatar for thompsonSensibl

Hi there, I am [B]stuck[/B] with a problem, and don't know where to start. I am given a series of cities, and their locations in [B]longitude and latitude[/B]. The goal is to find the two cities with the shortest distance. I have an algorithm which, given the geographical locations (longitude …

Member Avatar for NormR1
0
298
Member Avatar for baby_c

Hello friends.I got some problems with a program I'm developing for a assignment. I want to add a image(background) to my Jframe and add some buttons. I wrote the code. I can load image into the frame but when I create the Jbutton and re-size it to smaller button it's …

Member Avatar for baby_c
0
27K
Member Avatar for -acir-

[ICODE] I would like to ask assistance how I can retrieve all the scores every game. And how to add the points by not incrementing game 1 and game 2 and so on.. THank you... [/ICODE] [CODE] /* * To change this template, choose Tools | Templates * and open …

Member Avatar for -acir-
0
215
Member Avatar for purijatin

Hello, The problem is that some how due to garbage collection timings I am having tradeoff's in my performance. The issue can be generalized as: [CODE] public void loop(BlockingQueue<Runnable> queue) { for(Runnable runnable : queue)//line2 { runnable.run();//line4 if(Math.random() > 0.9) System.gc();//line5 } //line7 } [/CODE] Now normally the queue passed …

Member Avatar for purijatin
0
129
Member Avatar for warlord902

I am in situation like I have a class which have two different subclasses. [CODE]public class SuperClass{ String st; public String getSt(){ return st; } } class A extends SuperClass{ } class B extends SuperClass{ } [/CODE] Now I have another method that want to access the getSt inherited method …

Member Avatar for javaAddict
0
177

The End.