How to change the image of a selected File/Directory in JFileChooser while
Hi all,
I am trying to customize JFileChooser. Basically, I want to display a checked Icon for a selected directory(s) in JFileChooser
I know that fileView class returns icon for directory/files, but I am not sure how to change their images on selection.
your help is appreciated.
Ramesh
could you please anyone help me with this. I search all the web but I was not successful to find anything that would help me to create a custom renderer for JList component inside JFileChooser..
if you can give me some reference websites that would be great.
Ramesh
Similar Messages
-
How to change the images dynamically in a table.
Hai,
How to change the images dynamically in a table based on the condition in webdynpro abap.
Edited by: Ravi.Seela on Oct 13, 2011 2:17 PMThis has been much discussed earlier. Do search posts.
For your scenario i would do the following.
inside your node which is binded to the table, i create a new node image with cardinality 1 ..1 and a attribute called path of type string.
create a supply function for the node image .
Supply method now has a Element (Parent element ) and node.
Based on your record in element, set the right image source to path attribute and bind the node.
This will make sure that the framework calls the image supply function for every row in a table. -
How to change the image in title bar for JFrames
plz give me a small code to change the image of the JFrame in the Title bar.
i know how to change the name of the title bar .
import javax.swing.*;
class Rathna1 extends JFrame
Rathna1()
super("rathna project ");
public class Rathna
public static void main(String ax[])throws Exception
Rathna1 r=new Rathna1();
r.setVisible(true);
r.setSize(400,400);
Like this how to change the image of the title bar
Message was edited by:
therathnahi,
JFrame frame;
frame.setVisible(true);
frame.setIconImage(new ImageIcon("icons/img007.gif").getImage());
frame.setSize(800,600);
i think the thing u r searching is :
frame.setIconImage(new ImageIcon("icons/img007.gif").getImage());
~~~radha -
Is there a way to change the image numbers in a file in Aperture?
Is there a way to change the image numbers in a file in Aperture? We shoot with two photographers and so the img numbers are not in order but I would like to have the photos in chronological order on the disc when I give it to them. Does anyone know how to do this? I have them all in order ready to go in Aperture but when I move them to the disc to be burned they default back to the img number order. Thanks for your help!
What do you mean by "image number"? The file names like "IMG_7822.CR2" or "IMG_7822.jpg"?
You can create custom names with appended numbers, when you export your image files to be saved on a disk.
Sort your images by date in the browser, select them, then use the command "File > Export > Version" to write the files to the disk. Set the name format to "Custem Name with Index" or "Custom Name with Counter" to create numbered names in your current sort order.
Regards
Léonie -
How to place the images in Indesign xml file by Javascript?
How to place the images in Indesign xml file by Javascript?
We got the Indesign xml file, how to give the image placement link by Indesign javascript? Please help me its urgent.Hi,
You can pass the image url as a href attribute=> file:///Users/me/Documents/my_pic.jpg directly within your xml. It just needs that you pass a local, static and valid url.
If you want to add image later once the xml is flowed and so target specific nodes and inject images, it's a bit more complex. If the node is not part of the layout, you may try to reach the XMLElement objet and such an attribute, then layout the element.
var x = some XMLElement
x.xmlAttributes.add("href","file:///Users/m/Documents/my_pic.jpg" );
If already placed, then you have to get the associated pageItem, then place your file into it.
pagItm.place ( File ( "/Users/m/Documents/my_pic.jpg" ) );
Hope that helps,
Loic
http://www.loicaigon.com -
How to get the path when i select a directory or a file in a JTree
How to get the path when i select a directory or a file in a JTree
import java.lang.*;
import java.io.*;
import javax.swing.*;
import javax.swing.tree.*;
import java.awt.HeadlessException;
import javax.swing.event.*;
import java.awt.*;
import java.awt.event.*;
import java.util.Iterator;
* @author Frederic FOURGEOT
* @version 1.0
public class JTreeFolder extends JPanel {
protected DefaultMutableTreeNode racine;
JTree tree;
protected JScrollPane scrollpane;
final static int MAX_LEVEL = 1; // niveau max de descente "direct" dans l'arborescence
* Sous-classe FSNode
* @author Frederic FOURGEOT
* @version 1.0
private class FSNode extends DefaultMutableTreeNode {
File file; // contient le fichier li� au noeud
* Constructeur non visible
private FSNode() {
super();
* Constructeur par initialisation
* @param userObject Object
FSNode(Object userObject) {
super(userObject);
* Constructeur par initialisation
* @param userObject Object
* @param newFile File
FSNode(Object userObject, File newFile) {
super(userObject);
file = newFile;
* Definit le fichier lie au noeud
* @param newFile File
public void setFile(File newFile) {
file = newFile;
* Renvoi le fichier lie au noeud
* @return File
public File getFile() {
return file;
public JTree getJTree(){
return tree ;
* Constructeur
* @throws HeadlessException
public JTreeFolder() throws HeadlessException {
File[] drive;
tree = new JTree();
// cr�ation du noeud sup�rieur
racine = new DefaultMutableTreeNode("Poste de travail");
// cr�ation d'un noeud pour chaque lecteur
drive = File.listRoots();
for (int i = 0 ; i < drive.length ; i++) {
FSNode node = new FSNode(drive, drive[i]);
addFolder(drive[i], node); // on descend dans l'arborescence du lecteur jusqu'� MAX_LEVEL
racine.add(node);
// Gestion d'evenement sur JTree (on �coute les evenements TreeExpansion)
tree.addTreeExpansionListener(new TreeExpansionListener() {
public void treeExpanded(TreeExpansionEvent e) {
// lorsqu'un noeud est ouvert
// on descend dans l'arborescence du noeud jusqu'� MAX_LEVEL
TreePath path = e.getPath();
FSNode node = (FSNode)path.getLastPathComponent();
addFolder(node);
((DefaultTreeModel)tree.getModel()).reload(node); // on recharche uniquement le noeud
public void treeCollapsed(TreeExpansionEvent e) {
// lorsqu'un noeud est referm�
//RIEN
// alimentation du JTree
DefaultTreeModel model = new DefaultTreeModel(racine);
tree.setModel(model);
setLayout(null);
// ajout du JTree au formulaire
tree.setBounds(0, 0, 240, 290);
scrollpane = new JScrollPane(tree);
add(scrollpane);
scrollpane.setBounds(0, 0, 240, 290);
* Recuperation des sous-elements d'un repertoire
* @param driveOrDir
* @param node
public void addFolder(File driveOrDir, DefaultMutableTreeNode node) {
setCursor(new Cursor(3)); // WAIT_CURSOR est DEPRECATED
addFolder(driveOrDir, node, 0);
setCursor(new Cursor(0)); // DEFAULT_CURSOR est DEPRECATED
* Recuperation des sous-elements d'un repertoire
* (avec niveau pour r�cursivit� et arr�t sur MAX_LEVEL)
* @param driveOrDir File
* @param node DefaultMutableTreeNode
* @param level int
private void addFolder(File driveOrDir, DefaultMutableTreeNode node, int level) {
File[] fileList;
fileList = driveOrDir.listFiles();
if (fileList != null) {
sortFiles(fileList); // on tri les elements
// on ne cherche pas plus loin que le niveau maximal d�finit
if (level > MAX_LEVEL - 1) {return;}
// pour chaque �l�ment
try {
for (int i = 0; i < fileList.length; i++) {
// en fonction du type d'�l�ment
if (fileList[i].isDirectory()) {
// si c'est un r�pertoire on cr�� un nouveau noeud
FSNode dir = new FSNode(fileList[i].getName(), fileList[i]);
node.add(dir);
// on recherche les �l�ments (r�cursivit�)
addFolder(fileList[i], dir, ++level);
if (fileList[i].isFile()) {
// si c'est un fichier on ajoute l'�l�ment au noeud
node.add(new FSNode(fileList[i].getName(), fileList[i]));
catch (NullPointerException e) {
// rien
* Recuperation des sous-elements d'un noeud
* @param node
public void addFolder(FSNode node) {
setCursor(new Cursor(3)); // WAIT_CURSOR est DEPRECATED
for (int i = 0 ; i < node.getChildCount() ; i++) {
addFolder(((FSNode)node.getChildAt(i)).getFile(), (FSNode)node.getChildAt(i));
setCursor(new Cursor(0)); // DEFAULT_CURSOR est DEPRECATED
* Tri une liste de fichier
* @param listFile
public void sortFiles(File[] listFile) {
triRapide(listFile, 0, listFile.length - 1);
* QuickSort : Partition
* @param listFile
* @param deb
* @param fin
* @return
private int partition(File[] listFile, int deb, int fin) {
int compt = deb;
File pivot = listFile[deb];
int i = deb - 1;
int j = fin + 1;
while (true) {
do {
j--;
} while (listFile[j].getName().compareToIgnoreCase(pivot.getName()) > 0);
do {
i++;
} while (listFile[i].getName().compareToIgnoreCase(pivot.getName()) < 0);
if (i < j) {
echanger(listFile, i, j);
} else {
return j;
* Tri rapide : quick sort
* @param listFile
* @param deb
* @param fin
private void triRapide(File[] listFile, int deb, int fin) {
if (deb < fin) {
int positionPivot = partition(listFile, deb, fin);
triRapide(listFile, deb, positionPivot);
triRapide(listFile, positionPivot + 1, fin);
* QuickSort : echanger
* @param listFile
* @param posa
* @param posb
private void echanger(File[] listFile, int posa, int posb) {
File tmpFile = listFile[posa];
listFile[posa] = listFile[posb];
listFile[posb] = tmpFile; -
In A2500, how to change the Image Size?
I have an A2500 camera. The images are great, but they're huge (1.5mb each) and fill up my memory card way too quickly. How can I use the camera's menu settings so images are stored in a smaller size?
Hi TravelMark!
Thanks for posting!
To change the image size, please press the <FUNC/SET> button. select the [L], then change that to [M1] or [M2].
This didn't answer your question or issue? Find more help at Contact Us.
Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well. -
How to change the image in SAP network graphics
In my development with SAP network graphics, I found it difficult to change the image displayed in SAP network graphics. and i define the image path in IMG, it doesn't work. Is there any one who can tell me how to diplay a image in SAP network graphics. In my program the class cl_gui_netchart is used.
Thanks a lot!hi,
JFrame frame;
frame.setVisible(true);
frame.setIconImage(new ImageIcon("icons/img007.gif").getImage());
frame.setSize(800,600);
i think the thing u r searching is :
frame.setIconImage(new ImageIcon("icons/img007.gif").getImage());
~~~radha -
How to change the image of the favourtie portlet
Can anyone tell me how can I change the image of the favourite
portlet ? I found that I can only change the title text but not
the image. Any clue ?
Thanks.
-MaggieThis is a hard coded image in the 3.0.x releases of Portal.
If you want to change it, the only way you can do it today is to
replace the ml_us.gif file which you will find in
$ORACLE_HOME/portal30/images
This is the image for the US language, there will be one for
each language installed. e.g. ml_f.gif for French.
If you replace that gif file with an image of your own using the
same file name, then yours will be rendered rather than the
default.
Regards
Jason -
How to change the image of af:activeImage, in a Page Template, on click
Hello,
I am using jdeveloper 11g.
I designed a page template that contains a <af:activeImage> component. I use this component with <af:showPopupBehaviour> to show a popup when it is clicked.
I want to change the image of <af:avtiveImage> when it is clicked at the runtime. Is it possible to do this in a page template? How can I do this?
Thanks in advance,
Ozgur
Edited by: user8842411 on 15.Oca.2010 03:30
Edited by: user8842411 on 15.Oca.2010 08:19Substitution strings are meant to be static, like global constants.
If you need some variable stuff, use application level items and set them using Application level computations/processes -
How to change the image dynamically depend upon the input parameter
Hi All
I have one report running depend upon the Organization specific, I have 15 operating unit and 15 different logo for each operating unit.
How to change the Logo dynamically depend upon the input passed by the user.
If I have three or four logo i can add in my layout using if else statement and its works fine but i have more that 10 logos so its no possible to keep these in My RTF Template.
Is it possible to change the logo according to the input without keeping this in Template.
I have seen this link but its not working fine
http://erpschools.com/articles/display-and-change-images-dynamically-in-xml-publisher
Regards
Srikkanth.MHi,
I have not completed fully,so sorry i cant able to share the files, could you please give me some tips and steps to do.
Without having the logo in RTF if it possible to bring the logo depends on the user input (Ie Operating unit).
Regards
Srikkanth -
How to change the image of a signature?
Hi All,
I've to change the image of a signature in a sapscript.
It's name is Z_SIGNE, where coul I find it in SAP?
ThanksMy signatures were imported in SO10 in the form of HEX Macros.... See program RSTXLDMC, if I remember correctly, for how to upload graphics images....my signatures were scanned and coverted to TIFF files, and stored that way...and named like ZHEX-MACRO-HEADHONCHO, etc.
To display...insert a command like:
/: INCLUDE ZHEX-MACRO-HEADHONCHO OBJECT TEXT ID ST. -
How to change the image into byte and byte array into image
now i am developing one project. i want change the image into byte array and then byte array into image.
FileInputStream is = new FileInputStream(file);
byte[] result = IOUtils.toByteArray(is);
with apache common IO lib -
How to change the attributes of an XML file
hi peeps 'ope you can help me here i need to change the attributes of an xml file, i parse it first using a DOM parser but i cant find a way to change the attributes in the XML file, setAttribute() works only at runtime and doesn't change the attribute in the file itself. I can't find a method that will answer my question. I've searched through the forum and found similar threads....they say in order to write and change the attribute i must use the write() method of the XmlDocument class defined in com.sun.xml.tree.XmlDocument. But, i found another thread, and it says that com.sun.xml.tree.XmlDocument is not safe to use and i should use org.apache.crimson.tree.XmlDocument.....i can't find the XmlDocument class and the API for this package so i really dont know where to start...hope you guys can help me! thnx
thanks for responding roland....i already found the solution...i didn't use the XmlDocument class because i can't find any documents about it except for JAXP 1.0 here is my code snippet...i used the TransformerFactory and Transformer class to write
import org.w3c.dom.*;
import org.w3c.dom.traversal.*;
import javax.xml.parsers.*;
import javax.xml.transform.*;
import javax.xml.transform.dom.*;
import javax.xml.transform.stream.*;
Document doc = null;
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
dbf.setValidating(false);
doc = db.parse(fileGetFile); //this is the XML file
n1 = (Node)doc.getDocumentElement();
e1 = (Element) n1;
NodeList nodeList = doc.getElementsByTagName ("File");
//just insert whatever you want to do with the XML...parse it..set/change the attribute..etc....sample snippet below changes the attribute downloaded to "no"
for(int iWriteFailed = 0; iWriteFailed <nodeList.getLength() ; iWriteFailed ++){
n2 = nodeList.item(iWriteFailed);
e2 = (Element) n2;
e2.setAttribute("downloaded", "no");}
try{
TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer = transformerFactory.newTransformer();
transformer.transform(new DOMSource(doc), new StreamResult ( new FileOutputStream ( fileGetFile) ) );}
catch(Exception trans){}
thanks for responding and keeping the information interchange alive here in the forum...
Pau -
How to change the artwork of a video file???
is it possible to change the artwork of a video file. sometimes it comes up with its own artwork, and others there is just a black screen.... Thanks in advance
Have you changed the artwork in a song? It is the same thing with a video. If you havent changed any artwork before then simply right click on the song/video and click on Get Info>then the Art Work tab
Maybe you are looking for
-
Help--how to find a deleted image
Somewhere along the line I deleted a very precious master taken in August of 2007. When I look in my backup vault (on a Quadra external HD), I see a folder called "d2 Quadra deleted images." Inside are countless folders (and folders within folders wi
-
How can I change defaut date format to dd-mon-yyyy in bi analytics
hi.. How can I change the default date format to DD-MON-YYYY in BI Analytics... I am passing a date in a report from a prompt....but it is always taking "dd-mon-yyyy hh:mm:ss" format...I want to input the prompt in oracle's default date format i.e dd
-
Problem with the Browsing of Services Registry in Visual Composer
Hi, I have tried to connect Visula Composer of CE 7.1 to the Services Registry for ES Workplace by configuring 3 Web Service destination on my local server: 1. UDDI_DESTINATION 2. CLASSIFICATION_DESTINATION 3. Backend destination "HU2" as stated in t
-
How to set different bgcolors for rows int HtmlDatatable?
I have JSF HtmlDataTable on my page. I need to fill rows in table by different colors, according to row's data, but I can't find any method for it...... Should I use JavaScript in this case?
-
Where are the SMTP Server services, please?
Hello Not sure this is the correct forum but can't see anything else. I use Visual Studio with IIS Express server. I wish to set up and configure the SMTP services so that I can test STMP email scripts. The SMTP server has to be set up from the Contr