Hello AllAre there any examples to render a JTable in the Tree cells in a JTree. So as we expand every cell of the JTree we can display the values for that item right there in a JTable.Please let me know, it would be a great help.RegardsNaushin
Hello!Please help me. I add object of JLabel as component to the JTextPane, then I need to take text and component infor in save into my own file format. But I can't get position of the component in the text. What can I do?Here is code:p = new JTextPane();JLabel label = new ...
In JWindow, i do...JWindow j = new JWindow();j.getContentPane().add(new JLabel("this is a test"));j.show();ok...so this will show a label saying "This is a test" in the window (named j)Does anyone know what getContentPane().add() ... does to get the text from the label, to show it?just curious, ...
hi, i want to draw some stuff into each cell of my tables' column cells. therefore i tried the paint() method (the renderer extends JPanel). somehow this doesn't work. does anybody know how to do smth like this the right way?thnx here's the renderer class:public class MyTableCellRendererC ...
I am setting a model for a jtable based on which only the table will show data. If there is no data the jtable is not gettng displayed. I want to show a minimum 3 rows even if there are no data in the table. I tried creating the table like new JTable(3, 4) still the displayed number of rows is ...
Hi,I have a JScrollPane and want its content to be align at the top of the JScrollPane but I don齮 know how, right now the content is centered inside the JScrollPane.Thanks all,Al
51 byte By
shan19a at 2007-9-30 2:10:41
how to change the checkstyle of the checkbox
Hi,I have a JList object which has one element.So,when the user launches this application,I want the Jlist element to trigger offan application.Right now, the Jlist element is being displayed,and then only by clicking on thatelement, the concerned application get triggered off.Look at the ...
Here is the code:public class nQueensEst extends JApplet implements ActionListener { public Timer t = new Timer(1, this);//...the actionPerformed:if(e.getSource() == jButton1){nRainhas=Integer.parseInt(javax.swing.JOptionPane.showInputDialog("Quantas rainhas voc? deseja?"));t.start();int ...
Hello everybody,i-m trying to change a collapsed iCon creating a class which extends BasicTreeUI and then, in the jbInit method I write thisjTree1.setUI (new MyTreeUI ())and then I call updateUI method but It doesn-t work .... do you know what is happening__thank you ...
hello,i have an swing application that used by many users but i don't want to deploy it for each these users.i deployed it on only one machine under shared folder and i installed JVM for each users.it runs ok.i ask if there is a limit of number of users? what' are the bad things in this ...
Hello AllIm using the below shown renderer in my JTable but all it shows up is ...
Is it possible to load a html page in a JEditorPane and then have this page as a background while typing some text inside the same JEditorPane?
Hi,I have a JWindow that appears when an event occurs....so I do this:if(event occurred)myJWindow.show();then if u click on the jwindow that appears, it will close it by doing:myJWindow.setVisible(false);myJWindow.dispose();the next time the event occurs, the same JWindow appears before the new ...
I am required to plot graphs of network traffic (in terms of bytes/sec) over a 24 hr time period. How do I do this in java? Are there any APIs available that I can use in my applet? Can the graphs be stored in JPEG format?
1389 byte By
Kiffena at 2007-9-30 2:12:22
HiI now have a class called Gui and a class called Listener.The gui contains public class Gui implements ActionListenerpublic void actionPerformed(ActionEvent e) { }the Listener containspublic class Listener extends gui implements ActionListenerpublic void actionPerformed(ActionEvent e){ ...
Hi,I've been putting a FileFilter on my JFileChooser. It comes up with the correct filter, but it still allows the user to change to the "All Files" option. How do I disable that so the user is stuck with my filter?thanks for any help in advance,Geoff
110 byte By
javanuia at 2007-9-30 2:12:34
Is there any way of stopping a JFrame getting minimised when a menu item on another JFrame is selected?
212 byte By
timotia at 2007-9-30 2:13:07
dear all,may i know is there any method to capture the width and height of a physical monitor's screen. i need this information to place my JFrame at the center of the screen. thanxcheers...
Hello,I have the following code - which works under certain monitors but appears funny under flat screen monitors. Can you set the font using the html code like i have [this works] or can i set the font with a setFont() method.Regards,JohnString details = ("<html><table border=0 ...
357 byte By
Klamraa at 2007-9-30 2:13:23
Hi!Does anyone know what kind of Objects are contained in the Enumeration that is returned by getAttributeNames() in javax.swing.AttributeSet? I know, all objects are stored as Objects in an Enumeration. But of what type were these Objects originally? I have tried to type cast them to ...
I'm trying to make a table with the Header Renderer as a JTextPane. But with the code below when run the header doesn't appear but when you attempt do do anything with the table it repaints and the header appears.i thing there is something wrong with the initial Prefered Size of the ...
I want to convert my program form JFrame to JApplet. My question is JFrame uses main(). JApplet won't run the code in the main function. What do I need to do to make it work.
I need the size of a JWindow which contains a panel....when / how can I get this size?I tried getSize() before I show the window, but no luck.thanks.
Hi,I'm quite new to the java world but picking it up quickly.. For a uni assignment we've been told we have to use BlueJ and instead of making a fully featured app that could be compiled, just make one which can be tested using the create instance feature of this editor. The way we were ...
Dear Swing gurus,i would appreciate it if someone could help me with a JList question.I have a working chat program and i want to display a username nextto a user avatar/image.I have a JList that handles the users who log in:userModel = new DefaultListModel(); userList = new JList(userModel); ...
193 byte By
fungeea at 2007-9-30 2:15:13
im currently facing a problem that is how to refresh d from whenever a user cancel the operation?what is dispose?my second question is how to print jtable in a frame?thanks
964 byte By
cocoha at 2007-9-30 2:16:11
Hello All,I have a bit of a problem regarding JFileChooser. My application has 1 main window, and subwindows which are created when certain actions are performed on the main window. I want to create a file chooser when I perform certain actions on one of the subwindows, and make that chooser ...
922 byte By
tp78a at 2007-9-30 2:16:18
Hi,i have a myScrollPAne which include the textArea. I put the txt file into textArea. Problem is, that after i put the file into textArea the Vertical Scrollbar ' position is placed in max position i need to set it to value 0 , butmySrollPane.getVerticalScrollBar().setValue(0) doesn't ...
I add JLabels to my GUI at runtime. If user clicks on one of the JLabels, I wan to remove it. I was able to get this to work using individual JLabels, but not when I'm using an array of them.JLabel label[] = new JLabel[20];....//label_count is a running counter of how many labels I have on ...
Hi all,I have to edit a JTable in such a way that when a cell is in selected mode the data alreay in that cell should be cleared.If it is in editable mode then the data should be appended not cleared.Plz tell me how to solve this?Thanks &
Hi all,I have a send mail button in the application and on click of which i need to open the New Message dialog of the Microsft outlook. Can anyone help me with this.Thanks in advanceArpana
1054 byte By
buttspa at 2007-9-30 2:17:03
Hello ..!Well i have got a little problem, i want to join different Jbuttons using lines (drawLine). I have a JFrame in which i have different JTabPanes. In one of the Tabs there are 2 pannels and on the first Panel i have got 5 buttons. (arranged using '****dummyPanel.setLayout (new ...
is it possible to change the color of the text of a particular node in a tree.for that do we need to implement our own cell renderer for tree?
453 byte By
lee1112a at 2007-9-30 2:17:05
Hi, I was wondering if somebody could tell me what exactly i need to include to be able to note edits in a JTable cell.I have a JTable which uses JTextArea as an editor. When a user edits a value in a cell, i want to be able to note the cell which was edited, and retrieve the text from this ...
Hi all,I would like to implement a 'for loop' to add buttons to my panel depending on the value of max_number.The postion of these buttons will also change with each passing of the loop.The code below implements this. But when I click the buttons they only return the action listener of the ...
745 byte By
ovrubla at 2007-9-30 2:17:08
HTMLDocument.getText() issue: (HTML.Tag.BR) is translated to ' ' (space), but I've expected the '\n'!I have the HTMLDocument that contains <html><body>SOMETEXT</body></html>The JTextPane is perfectly showing this formatting, but after I translate the HTML to plain ...
I've got a JTable...the first time this table gets filled everything goes fine... I do this by callingMyTable = new JTable(rows, col);rows and col are Vector's.The rows and col gets filled by data out of a database.... I'll do this like in the next codewhile(MyResultSet.next()){for(int j = ...
354 byte By
pateldwa at 2007-9-30 2:17:33
Hi all,I want to send an Emoticon (image) to a user in my instant messenger. I have the statement (chat.sendMessage) for sending the message. But im not sure how to link the text to fire the image. Example:user types.... :) and smiley.jpg gets sent. How do I make the link ? can some one show ...
149 byte By
simbra1a at 2007-9-30 2:17:45
Hidoes anyone know how to take a string from a textfield and display the data of the textfield on another page.thanks in advance
535 byte By
ica78a at 2007-9-30 2:18:09
Hello all,hope somebody can help me with this one.I have a JTextArea on which I registered a KeyListener. Now, in case there is pressed a combination of keys (e.g. CTRL-C) I want to redirect this to a log file. Otherwise the pressed key has to be shown in the textarea. I noticed that the C is ...
280 byte By
javanuia at 2007-9-30 2:18:11
I have an application that uses JMenus. The problem is that the menu items get hidden behind a JFrame. I think this is due to the lightweight/heavyweight component problem. Is there anyway to get the menu items to appear on top of the JFrame and not get obscured behind it.
I need to write a simple XML/SVG code editor for my application. I basically want to display the contents of an XML DOM so that if the user changes the text in the editor the DOM will be updated to reflect this.What would be the best way to do this?
387 byte By
Exclama at 2007-9-30 2:18:28
hi!how can I create a JTree and JTable combination(if it is one), as it is used in programs like Shareaza or eMule?i want to have a folding jtree that can contain more informations, e.g. graphical download status elements or extended file information. Can you give me a sample sourcecode for ...
Hi,I have a JLabel with an icon that is clock. After an event occurs, I want to change the icon of the label to a calendar. (logically, doesnt make sense..why a clock/calendar...its an example).Anyway, when the event occurs, I do this:label.setIcon("mycalendar.gif"); label.repaint();// i also ...
357 byte By
genepia at 2007-9-30 2:19:11
Hi,I want to create a toolbar where the user can select the group of tools visible. Something like this: http://doc.trolltech.com/qq/qq07-qt32-an-even-better-qt.html#newtoolboxwidgetAny idea how I can do it? Or screenshots of Swing toolbars with similar functionalities? How to manage horizontal ...
I have a JTable whose values gets filled only dynamically.At times, when the table is empty, I want to show a message like "no records found" just under the table header.Just like how in windows machine, when you make a search and if it doesntreturn any records, it prints "Search is complete. ...
289 byte By
vkt1977a at 2007-9-30 2:19:13
I am trying to launch my Java Swing Application .But getting the error Xlib: unexpected async reply on Linuxand sometimes java dumps saying some issue with ImageICON which i am creating in Global Scope.Can anyone help.pleas reply to vinaya.kumar.t@hp.com
I start a timer in the applet init method and restart/start the timer if it is not running in the applet start method. Since the start method is invoked by anther thread, it can run before the init method is completed. That is an undesired situation. What is the better way to handle the timer ...
how can i do this, which object in the tree recibe Mouse or MouseMotion events?Thanks!