JTable inside a JTree

279 byte By naushinga at 2007-9-30 2:09:56
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

JTextPane how to get position of embedded component

911 byte By BabyToys2a at 2007-9-30 2:09:58
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 ...

JWindow - add component, what is it adding...

443 byte By codecraiga at 2007-9-30 2:09:59
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, ...

draw lines in TableCellRenderer

792 byte By mischka24a at 2007-9-30 2:10:10
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 ...

JTable problem

408 byte By want2bexperta at 2007-9-30 2:10:17
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 ...

JScrollPane Problem

206 byte By alejandrosha at 2007-9-30 2:10:25
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

change the checkstyle of checkbox

51 byte By shan19a at 2007-9-30 2:10:41
how to change the checkstyle of the checkbox

Launching an Application from a JList

2485 byte By bhuru_luthriaa at 2007-9-30 2:10:42
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 ...

javax.swing.Timer not working or event not being captured by actionPerfrmd

1663 byte By wilsonetoa at 2007-9-30 2:10:44
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 ...

TREEUI DON-T CHANGE

311 byte By tlloretia at 2007-9-30 2:10:56
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 ...

deploy swing application on one machine and used many users?

385 byte By javakilltora at 2007-9-30 2:11:00
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 ...

JTable inside a JTable (nested Tables)

1865 byte By naushinga at 2007-9-30 2:11:25
Hello AllIm using the below shown renderer in my JTable but all it shows up is ...

Is it possible (JEditorPane)...?

150 byte By veroslava at 2007-9-30 2:11:44
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?

Same JWindow appears again?

386 byte By codecraiga at 2007-9-30 2:12:03
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 ...

plotting graphs

229 byte By hbhargavia at 2007-9-30 2:12:21
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?

Action listener in different class

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){ ...

Disabling "All Files" Option For JFileChooser

280 byte By geoffrobinsona at 2007-9-30 2:12:23
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

JFrame

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?

How to obtain Monitor's screen dimension

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...

JOption + HTML

846 byte By longieDITa at 2007-9-30 2:13:13
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 ...

TextAttributes

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 ...

JTextPane as Table Header Renderer

5365 byte By JCDoerringa at 2007-9-30 2:13:34
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 ...

convert JFrame to JApplet

183 byte By weeshmana at 2007-9-30 2:13:35
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.

how and when to get the size of a JWindow

170 byte By codecraiga at 2007-9-30 2:13:39
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.

Look and feel / actionPerformed on combo

1672 byte By sfrost007a at 2007-9-30 2:14:45
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 ...

2-columns JList: String + image: HELP!

1210 byte By Giorgos@a at 2007-9-30 2:14:55
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); ...

how to refresh a jframe?

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

Quick question: JFileChooser mode

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 ...

JscrollPAne and set position of Scrollbar problem

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 ...

addMouseListener with Array

1282 byte By IceMan7255a at 2007-9-30 2:16:24
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 ...

JTable cell Editing

299 byte By venkatbalajia at 2007-9-30 2:16:31
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 &

Send mail using Java

217 byte By ArpanaD.Na at 2007-9-30 2:16:53
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

Draw Lines..!

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 ...

changing the color of node in a JTree

156 byte By senthilpsa at 2007-9-30 2:17:04
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?

Noting edits in a JTable cell

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 ...

Tricky problem. Change button name with each for-loop

1258 byte By johnnyhall81a at 2007-9-30 2:17:06
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 ...

HTMLDocument.getText() issue: HTML tag is translated to ' ' (space)?

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 ...

Help please

2264 byte By Follyaxela at 2007-9-30 2:17:19
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 = ...

Mapping String to image

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 ...

have any idea in..........................

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

How to detect a combination of pressed keys

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 ...

JMenu

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.

Writing a simple XML editor

263 byte By blue_harvestera at 2007-9-30 2:18:16
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?

JTree and JTable combination

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 ...

Change labels icon - not appearing

686 byte By codecraiga at 2007-9-30 2:18:59
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 ...

Toolbar with groups

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 ...

empty JTable

2314 byte By krrajesh2a at 2007-9-30 2:19:12
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. ...

Xlib: unexpected async reply on Linux :URGENT

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

Using Swing Timer in Applet

339 byte By vwuvancouvera at 2007-9-30 2:19:44
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 ...

Highlighting nodes in a JTree

100 byte By franmorenoa at 2007-9-30 2:19:45
how can i do this, which object in the tree recibe Mouse or MouseMotion events?Thanks!