Client-Side Development Section Index | Page 4
How can I print the contents of a JTable as a report? - J2SE 5
How can I print the contents of a JTable as a report with title, date/time etc. as a formatted report on a paper?
How can I call a Java method from Javascript?
How can I call a Java method from Javascript?
How can I send an attachment without having to use a physical file? - 08.31.06
How can I send an attachment without having to use a physical file?
Read a file in script!! HOw can we Read a file using Java Script.. My requirement is i have to read a file in java script.. Can anyone tell me how to do that..
ActiveX can be used. However, be aware that an increasing number of people are not using internet explorer on windows (either due to alternate browser or due to alternate operating system) so Acti...more
Are there any predefined file filters for a JFileChooser?
Apart from the accept all filter, until Java 6, there were no predefined filters. Java 6 introduces the FileNameExtensionFilter, allowing you to define one or more types of files for the user to s...more
Is it possible to set session variables from javascript?
Is it possible to set session variables from javascript?
How do you discover the set of mime types supported by your platform for the Mobile Media API?
The Manager class offers a getSupportedContentTypes() method for just such a purpose. Pass in a value of null to get the whole set returned.more
Is it possible to adjust the tempo when playing back a MIDI file using the Mobile Media API?
That would be with the TempoControl. Get it from the Player and call the setTempo() method, passing in a value for the number of milli-beats per minute.more
Using the Mobile Media API, how do you control the volume of what is played?
You need to get the VolumeControl object from the Player and change the volume through that:
vc = (VolumeControl) player.getControl("VolumeControl");
if(vc != null) {
vc.setVolume(50);
}
more
Using the Mobile Media API, how do you find out information like song title?
You have to get the MetaDataControl object for the associated player. There are four predefined keys that you can ask for: TITLE_KEY, DATE_KEY, COPYRIGHT_KEY, and AUTHOR_KEY, though other informat...more
Using the Mobile Media API, how do you generate a tone?
The Manager has a static playTone() method to generate tones. You can also create a Manager.TONE_DEVICE_LOCATOR player object with Player player = Manager.createPlayer(Manager.TONE_DEVICE_LOCATOR)...more
Using the Mobile Media API, how do you know when a song/video is done playing?
You need to attach a PlayerListener to the Player.
Using the Mobile Media API, how do you play a media file stored in an RMS record store?
RecordStore rs = RecordStore.open("name");
byte record[] = rs.getRecord(id);
ByteArrayInputStream bais = new ByteArrayInputStream(record);
Player player = Manager.createPlayer(bais, "audio/x-wav"...more
Using the Mobile Media API, how do you play a sound file that comes in the JAR?
You need to know the mime type of the audio file and pass it as a stream to the Player object.
InputStream is = getClass().getResourceAsStream("/example.wav");
Player player = Manager.createPlaye...more
Using the Mobile Media API, how do you take a picture?
Use the locator string of "capture://video" to create the Player, then get the VideoControl for the viewfinder, and finally VideoControl.getSnapshot(String type) to take the picture.