|
Your program will throw away every tmpCustFile object you create. Is this really what you intended?
Also, I think your //etc. part chopped off some important bits.
Also, why did you ignore standard naming procedures? myCustomFileClass should be MyCustomFileClass, to remind you that it's a class, not an instance.
You said:
TylerD75 wrote: At first I thought it was the FileArray that had reached its end, but it has room for a lot more (I amped it up after hitting this problem).
Then I thought it could be the MediaObjectArray that had reached it's end, but after increasing it nothing changed.
What are the two classes you mention? I did not see those anywhere in your code snippet.
From your words, you are storing objects somewhere. From your code, you are not. Please fix one or the other and maybe we can give a better answer.
Don't let my name fool you. That's my job.
|
|
|
|
|
Hi Guys, I am developing a system for my college's final year project and I plan to use JAVA for this ..
The topic of my system is a food ordering system, can i get some opinions from you guys...about ...
1. You guys should know, the GUI for a food ordering system is quite important since the application will be installed in the PC that placed at the table (in the restaurant), so the customer can order directly without the helps from the waiters, my problem is, Is Java good enough for developing such Strong GUI ? I have limited knowledge to Java may be, I found out that the Java's GUI (those built-in one like the provided by the JAVA APIT) is quite bored.... it not really looks like something that is for strong User Interaction....
2. Regarding to question 1, if I develop this food ordering system with java APPLET.... or the JAVA FX... will it be better?
Guys... I need your opnions ^.^" any opinions regarding to this food ordering system..... thanks for the time to read this message...
|
|
|
|
|
You don't have to develop your Java app just for the Web, you can make it a stand-alone app and run it on your PC, and if you have the PC networked (let's say to the "kitchen"), then the order can be read there and processed. I would suggest you take a look at www.java.sun.com --- there are many tutorials on there, and if you want a web-based app, they have an "ordering system" tutorial, with code, that you can base your application on.
Good luck!
AF Pilot
|
|
|
|
|
this is my first smart card project. i have to program the card in java using the API,i want the code that will allow the card to communicate to the pc.pls the code should support the API . that is what i am required to use for the project.
thank you.
|
|
|
|
|
what type/brand etc of smart card ?
Most of these gizmo's come with some sort of API from the manufacturer that has samples of how to use it - so the manufacturer's web-site or rep will usually be able to help you
'g'
|
|
|
|
|
i want to know the code of Find numbers in a given string with java
|
|
|
|
|
what kind of number ? integer ? float ?
Integer i = Integer.parseInt("4");
|
|
|
|
|
I don't find a suitable method to write ArrayLists to a text file. Does each attribute of the class objects that make up the ArrayList have to be written separately? When I wriye the class object of the ArrayList, it just writes out the memory location. Any advice would be much appreciated.
Thank you.
AF Pilot
|
|
|
|
|
you have to loop through the array list and get each array and print it through loop two
for example
private void printArryList(ArrayList<string[]>someList)
{
int counter=0;
for (int i = 0; i < someList.size(); i++) {
System.out.print("["+(++counter)+"]");
for (int j = 0; j < someList.get(i).length; j++) {
System.out.print(someList.get(i)[j]+" ");
}
System.out.println();
}
}
|
|
|
|
|
Thank you very much. I couldn't find much about writing out an ArrayList to a file in any of the Java documentation or tutorials (that appeared understandable to me, anyway). Much appreciated.
AF Pilot
|
|
|
|
|
Hello Friends,
I am looking for a solution to extract following meta data information from WMV file
1. Width
2. Height
3. Duration
4. Bit Rate
Can anyone please suggest me how I can start my RnD journey to achieve this solution.
Any help would be highly appreciated.
Thank You,
Java Developer - First Time
|
|
|
|
|
i dont know the exact program , but still i use Mediainfo . To download mediainfo.exe it will shows bitrate , size,bandwodth .. etc..
Thanks
mani.G
|
|
|
|
|
You need to learn about the format itself. Try Wikipedia for starters:
http://en.wikipedia.org/wiki/Windows_Media_Video[^]
Once you know the format, you'll need to look into Java file handling routines.
Don't let my name fool you. That's my job.
|
|
|
|
|
Hello guys
i am new to java and i have some problem that going to make my head explode
i am stuck on this thing for a week now
i need to read data file by column not by lines
for example
i have the following data file
6, 148, 72, 35, 0, 336, 0627, 50, 2
8, 183, 64, 0, 0, 233, 0672, 32, 2
1, 85, 66, 29
1, 89, 66, 23, 94, 281, 0167, 21, 1
0, 137, 40, 35, 168, 431, 2288, 33, 2, 10, 9, 125
5, 116, 74, 0, 0, 256, 0201, 30, 1
i need to read it coulmn by coulmn and store it to arrays
for exaample the first array would be {6,8,1,1,0,5} and so on
all what i have done is read it line by line and thats not working for me
this what i've done so far
public class VariableTransformation
{
private String FileName = "";
private FileReader FileReader;
private BufferedReader buffFile;
private ArrayList<string[]> attrDomainList = new ArrayList<string[]>();
private String[] item=null;
public static void main(String[] args)
{
VariableTransformation tds = new VariableTransformation();
Scanner input=new Scanner(System.in);
System.out.println("===============================================");
System.out.print("Enter the file name>> ");
String filename;
filename=input.next();
tds.fileLoad(filename);
System.out.println("===============================================");
}
public void fileLoad(String fileName)
{
String line = "";
String[] attrDomain;
FileName = fileName;
System.out.println("> Reading File..");
try {
int lineCount=0;
int size=0;
FileReader = new FileReader(FileName);
buffFile = new BufferedReader(FileReader);
try {
while((line = buffFile.readLine()) != null)
{
item = line.split(",");
size=item.length;
attrDomain=new String[size];
for (int i = 0; i < item.length; i++) {
attrDomain[i]=item[i];
}
attrDomainList.add(attrDomain);
lineCount++;
}
printData(attrDomainList);
System.out.println("> Finish File Reading.");
System.out.println("Number of Lines>> "+lineCount);
System.out.println("===============================================");
}
catch (IOException e) {
System.out.println(e.getStackTrace().toString());
System.out.println("# Error while reading file .");
}
finally
{
try {buffFile.close();} catch (IOException e) {e.printStackTrace();}
try {FileReader.close();} catch (IOException e) {e.printStackTrace();}
}
} catch (FileNotFoundException e) {
System.out.println("> Error. Target File Don't exist.");
e.printStackTrace();
}
}
private void printData(ArrayList<string[]> dataFile )
{
int Counter=0;
for (int i = 0; i < dataFile.size(); i++) {
System.out.print("["+(++Counter)+"] ");
for (int j = 0; j < dataFile.get(i).length; j++) {
System.out.print(dataFile.get(i)[j]+" ");
}
}
}
}
HELP PLEASE
|
|
|
|
|
|
you're on a forum for help about Java programming... so, what's your question ?
|
|
|
|
|
My question was what Java-programmers think about unusual approach to Java-programming which is described in the article above
|
|
|
|
|
On other forums, this might get modded down as "Unworthy Self Link". I think you should not have posted it here.
As for the article, a brief skimming leaves me quite confused. I think you need more organization. At what point do you show how to write C-style programs? And why do you think those are different from Java, which is already C-style?
Are you planning to write a big main() block of straight line code? I do not see the advantage of that. Teaching bad coding practices to Java beginners seems like a really inappropriate thing to do.
Don't let my name fool you. That's my job.
|
|
|
|
|
I make an excuse for tempering you (as the other forum members) for advertising my article. It is not because lack of modesty but more because I am very old programmer and still consider all kind of forums as public bulletin boards. The times changed, I see it now. The article is addressed to MPU-programmers, who know classical C and don't want to learn Java. The problem is: simple and cheap Cellular Phone is very userful device for MPU-programmes but its software includes only J2ME. I suggest the way for them to use Cell Phone (not Java) as device communicating with MPU's. I posted my link on Java pages to get professional critics of my sourse-code which to my mind has many interresting solutions. I had no intention to teach Java programmers.
|
|
|
|
|
or even further to my BBS days, cross-posting in inappropriate forums was still a big no-no.
I suppose you may have come from pre-Darpanet days when there were no such things as topics. Maybe while you were dodging dinosaurs you'd post wherever you could as fast as possible, just in case a sabre tooth tiger came along or a mammoth tromped on you.
But, yeah, even the earliest versions of America Online had rules. Somehow you missed those...
Don't let my name fool you. That's my job.
|
|
|
|
|
Here's what I'm using to change out the image content in an iframe,
client really needs to have each image linkable, is it possible to add a url variable and array to make each image on click go to a specific URL?
Tryed a few things with my limited java knowledge and can't seem to make it happen.
Any help/suggestions wickedly appreciated!
Script:
<script type="text/javascript">
<!--
function showImage(imgName) {
var curImage = document.getElementById('screenImg');
var curUrl = document.getElementById('screenUrl');
var thePath = 'img/';
var theSource = thePath + imgName;
var theTarget = 'screenImg'
curImage.src = theSource;
curImage.alt = imgName;
curImage.title = imgName;
curImage.target = imgTarget;
}
//-->
</script>
Html:
<iframe src="img/image1.jpg" width="500" height="200" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" name="screenImg" id="screenImg" class="scframe"></iframe>
<a href="#" onMouseOver="showImage('image1.jpg');">Link 1</a><br />
<a href="#" onMouseOver="showImage('image2.jpg');">Link 2</a><br />
<a href="#" onMouseOver="showImage('image3.jpg');">Link 3</a><br />
<a href="#" onMouseOver="showImage('image4.jpg');">Link 4</a><br />
<div class="ForumMod">modified on Wednesday, January 14, 2009 2:41 PM</div>
|
|
|
|
|
|
HI,
I am using Javascript for bookmark in my project.Here is the code
function prepBookmarkLink() {
if (window.sidebar && window.opera && window.print) {
var bkmkLink = document.getElementById('bookmarkLink');
// bkmkLink.rel = 'sidebar';
// bkmkLink.href = location.href;
// bkmkLink.title = document.title;
// bkmkLink.setAttribute('href',document.URL);
// bkmkLink.setAttribute('title',document.title);
// bkmkLink.setAttribute('rel','sidebar');
// bkmkLink.click();
}
}
function bookmark(){
var title = document.title;
var url= document.URL;
var ua=navigator.userAgent.toLowerCase();
var isKonq=(ua.indexOf('konqueror')!=-1);
var isSafari=(ua.indexOf('webkit')!=-1);
var isMac=(ua.indexOf('mac')!=-1);
var buttonStr=isMac?'Command/Cmd':'CTRL';
if(window.sidebar){
window.sidebar.addPanel(title,url,"");
}
else if(window.opera && window.print) {
prepBookmarkLink();
// (document.write('<a href ="javascript:bookmark()");">Add Bookmark</a>'));
var elem = document.createElement('a');
elem.setAttribute('href',url);
elem.setAttribute('title',title);
elem.setAttribute('rel','sidebar');
elem.click();
// var a=document.createElement('a');
// a.href=location.href;
//
//
// a.rel='sidebar'; // this makes it work in Opera 7+
// a.click();
//
// a.title=document.title;
// return cont.appendChild(a);
// //
document.write('<a href = "'+url+'" title="'+title+'" rel="sidebar">Bookmark Site</a>');
alert('test');
}
else if(window.external && (!document.createTextNode ||
(typeof(window.external.AddFavorite)=='unknown'))) {
// IE4/Win generates an error when you
// execute "typeof(window.external.AddFavorite)"
// In IE7 the page must be from a web server, not directly from a local
// file system, otherwise, you will get a permission denied error.
window.external.AddFavorite(url, title); // IE/Win
} else if(isKonq) {
alert('You need to press CTRL + B to bookmark our site.');
} else if(window.opera) {
alert("dfsdf");
void(0); // do nothing here (Opera 7+)
//return true;
} else if(window.home || isSafari) { // Firefox, Netscape, Safari, iCab
alert('You need to press '+buttonStr+' + D to bookmark our site.');
} else if(!window.print || isMac) { // IE5/Mac and Safari 1.0
alert('You need to press Command/Cmd + D to bookmark our site.');
} else {
alert('In order to bookmark this site you need to do so manually '+
'through your browser.');
}
}
|
|
|
|
|
1) you don't follow the posting guidelines and the messages formatting rules.
2) this is not Java, it is Javascript, so ask the right forum if you want to get relevant answers about this.
Also, I'm sure google knows plenty of cross-browsers working solutions
|
|
|
|
|
I've got an Object array that holds various types of objects. I'm trying to code up some sort of parameterized class or method that will print the contents of those objects.
This array belongs to the framework, and is populated accordingly before a notification routine is called. For example, if the notification routine is called with a value of 100, I know the array contains Orange objects, if it is called with a value of 200, I know the array contains Apple objects, etc. In the notification routine, I need to call a "print" function that will print the contents of the object regardless of its type.
Here's how I am currently doing it:
case 100:
Orange orange = (Orange) m_objectNames[0].getListObject();
printContents(new Orange(), m_objectNames);
break;
case 200:
Apple Apple = (Apple) m_objectNames[0].getListObject();
printContents(new Apple(), m_objectNames);
break; Is this clear as mud? My print function looks like:
public static <T> int printContents( T t, ObjectName objNames[] )
{
for (int x = 0; x < objNames.length; x++)
t = (T) objNames[x].getListObject();
} The loop runs the correct number of times, but I can't figure out how to access the methods and properties of the T objects.
- DC
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|