Menus

62 byte By cjo_78a at 2007-9-30 1:46:54
What is the difference between a JList and a JCombobox?

saving images drawn on a label?

874 byte By samir_battaa at 2007-9-30 1:47:00
Hi I am trying to save an image(as jpeg) after I draw a rectangle on a JLabel which displays an image using Image Icon. I am completely lost as to how to do it...all i get is black imagehere is what i tried in my action performed if (source == nextButton) {//snip -writing to an imagetry ...

Size of Object for AbstractTableModel with JTable

576 byte By psllooa at 2007-9-30 1:47:11
Can someone please help me. I am creating a JTable with AbstractTableModel and the table is populated from the database. As I understood it, I can only create an Object[][] of fixed size to store the data. My problem is that the number of rows returned from the database is unknown. How can I ...

Table Model and DataBase

161 byte By wilsonetoa at 2007-9-30 1:47:21
Whats is the easiest(or best) way to query data from a DataBase and display it in a JTable, I have to implement a Tabel Model? How to do it?Thanks

image & jpanel problem

815 byte By grigoris59100a at 2007-9-30 1:47:25
i have a jframe and inside there are 2 jpanels and one of them has inside of it another one. i want the last jpanel (this that is inside the other) to display an image that i choose from a filechooser.i have done it upto the display where i can not add an image inside the jpanel.file is an ...

Execute html file from java code - urgent!!!

427 byte By alonusha at 2007-9-30 1:47:26
Hi,I need help!!My application should open html file that located in my computerit should be open when some line in JList was choosenmy question is: How can I open html file from my applicationI work with window XPI tried this one : Runtime.getRuntime().exec(cmdLine);but it doesn't workthe ...

Force JLabel update?

1238 byte By Stez1982a at 2007-9-30 1:47:27
Hi,I am developing a java based game that is vary similar to chess. It is event driven in terms of the input from the user to select their move.However, when it gets to the computer's turn, rather than just calling a method to calculate it, a new thread is started to work out the computer's ...

Cyrillic Characters in a HTML File

665 byte By hinterwaeldlera at 2007-9-30 1:47:48
HelloI'm trying to display a html help file containing Russian text, with cyrillic characters. The html file is saved with Unicode (UTF-16LE). The swing component (JEditor) doesn't seem to be able to read the characters right. I tried to encode all Russian characters in the html file ...

how to add JTable in scrollpane at run time

398 byte By baliiia at 2007-9-30 1:47:53
On a jpanel i put scrollpanel and then jtable, working in jbuilder. now i want to update the jtable from the database by sending a query to database on clicking a button. the query response may contain 2 or more columns. Kindly any one can tell me what should i do. can any one send code example ...

How can I arrange the components in a better layout?

244 byte By Adrian8311a at 2007-9-30 1:48:08
Hi, I found that the layout manager is not enough for me to put things around, there's only some straight position like east, south, southeast, etc. Is there anyway I can put the component in a particular point? Thx.Adrian

How can I leave an empty row?

266 byte By Adrian8311a at 2007-9-30 1:48:23
Hi, If I want to use GridBagLayout, how can I leave an empty row? Or empty column? When I create the buttons on a frame, are they created sequentially? so Is that mean I can't put something back to the first row later in the program? Thx.Adrian

Can you recommend a good Java GUI app book?

311 byte By pieter3da at 2007-9-30 1:48:48
HelloI want to write a java pp with a fairly extensive GUI (swing), and I want to do it right.I am looking for a book that covers how to organize all the GUI components into classes, and orginazation of dialog boxes, action and event handling and such.Anyone know a good book for ...

look java

148 byte By java1_funa at 2007-9-30 1:48:57
Hi evry one, is there any one who can give me links to get a java look implementation other than metal, motif, gtk, windows, mac. Thank you.

Synchronizing JEditorPane

404 byte By FredianeliAa at 2007-9-30 1:49:09
I use a JEditorPane to display contents of a text file.The file gets updated by other tasks without any call to Document API butwith direct writes.There's a direct way to get the pane uptodate with file changes in a synchronous way?I could check file date after certain time intervals and ...

JOptionPane: adding multiple Components

388 byte By kevinsikoraa at 2007-9-30 1:49:13
Hello,I am trying to add multiple components to a JOption Pane. When the JOptionPane is displayed, the JOptionPane is not resized in order to display all of the components. In my case, the buttons of the JOptioPane are pushed down. Only the upper half of buttons are visible.How do you set the ...

Render

604 byte By sdnsdlma at 2007-9-30 1:49:14
Hi to everybody,Supposing 3 JTables, with these column names (headers):JTable1:Column1: NAME_AColumn2: NAME_BColumn3: NAME_CJTable2:Column1: NAME_AColumn2: NAME_DColumn3: NAME_EJTable3:Column1: NAME_BColumn2: NAME_FColumn3: NAME_GWhat I want to do is to apply a renderer to the tables deppending ...

Panel Refresh

193 byte By mykrobioa at 2007-9-30 1:49:15
hi all,i need a trick to avoid the flicker in my Panel when i update the information of their labels. somebody tell me something about double buffering, what's that?thanks

Focus

529 byte By zzpprka at 2007-9-30 1:49:40
Hi All...Got a bit of a problem with Internet Explorer and JDialog.I have an applet with a modal dialog (JDialog). Problem is: if I switch to another app running on my PC and then back to the my applet running in IE, it appears frozen as the dialog is still open but hidden behing all other ...

Adding Panel at Runtime

148 byte By nyasatrivedia at 2007-9-30 1:49:41
I want to add panel at runtime in center of content pane when i press label which is in another west side panel.Reply fastthanx

JDIalog and title

329 byte By braydunesa at 2007-9-30 1:49:43
Hi,I use a JDialog to get an objet's name. So i redefine the content in witch I add some button.The title of this window is larger the new content. And when i show this window, the size is calculated on the size of the content so i can see the complete title.Is someone who can help me ...

JComboBox Backgroud Color

657 byte By Gras_22_Gras_22a at 2007-9-30 1:50:34
Hi,I need some help working with teh background of a JCombobox. We develop in java 1.2.2. here we set the background of some comboboxes to red using setBackground on the Combobox. This works fine the selected item in the combobox will be red.Next if we run the code in java 1.3.1 (Server ...

JTable using ListSelectionModel

454 byte By psllooa at 2007-9-30 1:50:40
I have implemented a Jtable with the ListSelectionModel. I use getMinSelectionIndex and getMaxSelectionIndex to tell which row has been selected. It has one small problem. If the row has already been selected and the same row is selected again the Listener will not trigger. I need to know if a ...

Opaque Variable not being Serialized

337 byte By edenorigina at 2007-9-30 1:50:54
Dear All,Could someone please shed some light on the following.I set a component's Opaque variable to false and then it is serialized into a file for storage. When reloaded from the file, the opaque variable has been reset to true?Does anyone have any ideas?Many thanks in ...

TableModel placement in MVC

168 byte By TheLokusta at 2007-9-30 1:51:10
If my View is simply presentation; my Model is "pure" data; and my Controller is behavior, in which class do I put any TableModels, TreeModels, etc? Derek

displaying the top level container

903 byte By patyorka at 2007-9-30 1:51:15
Morning all!!This is probably a stupid question but I have a program I wrote that runs a piece of semiconductor tester equipment. In the program there is a loop which sets the voltage/timing parameters then runs a test to determine pass or fail.The screen only updates when the loop completes ...

JTable Advance

350 byte By alejandrosha at 2007-9-30 1:52:15
Hi,I have a JTable and want to have an special Header in the following way:--Title for column 1,2 y 3 --|--Title column 4 y 5-|--colum1--colum2-colum3|-column4-column5|cell1 - ...I want to put the table in a JScrollPane so the whole header is adjusting to the cells of the tableAny ...

Urgent help regd setting Backgrnd color.Please see

1110 byte By bhuru_luthriaa at 2007-9-30 1:52:17
Hi,I need some urgent help regarding setting the background of the list to whiteand displaying the string in black in my cell renderer.The background is blue,the selected index is red,which I dont want.I want the entire background white,the list elements displayed in black,and theselected list ...

Recommended icon editor?

1200 byte By MichaelSchepera at 2007-9-30 1:52:18
In today's episode of I can't believe I can't find it in a forum...I want to create platform-independent icons (ImageIcons). I'd love it if Java could render disabled ('dimmed') versions of those icons for me, but it's not essential. I know I can draw them with code, but in a lot of ...

editable JTextArea

250 byte By eeoam2a at 2007-9-30 1:53:11
I need to paint a JTextArea directly to the JPanel like so:JTextArea t = new JTextArea();t.paint(g);But when I do so I cannot edit the JTextArea. Are there methods I can invoke which allow the JTextArea to become editable?

Tiled background image

4355 byte By joape382a at 2007-9-30 1:53:14
Hi,I wonder if it is possible and if, how you do, to tile a background image in a JApplet.Here is one answer I got previously:import java.awt.*;import javax.swing.*;public class TestApplet extends JApplet { public void init() { setContentPane(new MyContent()); this.getContentPane().add(new ...

Background of a JPanel to a .gif file

453 byte By cmcvickera at 2007-9-30 1:53:31
Hey. This might be something that shows up on here alot but, does anyone know how to set the background of a JFrame or JPanel to a .gif file? I am struggling big time on this problem. It's a simple program that I'm working on that deals 2 hands of blackjack in a JPanel, and I'm trying to set ...

repainting swing components

352 byte By RGbeana at 2007-9-30 1:53:54
public class aPanel extends JPanel {//...protected void PaintComponent(Graphics g) {System.out.println("repainted");}}if I have a custom JPanel that looks like this, i can't seem to repaint it:ie:aPanel p = new aPanel();p.repaint();nothing happenshelp.. ...

Replacing HTML tags using HTMLEditorKit etc.

1817 byte By blakjack22a at 2007-9-30 1:53:56
HiNot sure if this is the best place to ask this. I've searched without finding much.Basically I am trying to create a HTML template system for output. User's can change the templates to change the program output.The templates are basic HTML with custom tags inserted, that reside in a ...

MouseEvent.getButton() not working for MouseMotionListener?

1613 byte By jvanderwalta at 2007-9-30 1:54:10
Hi allIt seems to me that the convenience method MouseEvent.getButton() always return 0 when called from within a MouseMotionListener's mouseDragged() method. Can anyone please enlighten me as to the reasons why?ThanksHannespublic class MyMouseListener implements MouseListener, ...

textArea

156 byte By lks_plma at 2007-9-30 1:54:26
hi, i am a newbie here, just wantto ask a simple question. How to hightlight or set a color of a particular word in a textarea which consist of text.

Title less window with menu bar and rounded corner

673 byte By SantDasa at 2007-9-30 1:54:37
Hi everybody,I need an application window which should not have title bar, but in menu bar right corner we should have minimize/resize/close buttons. application window should resize and move from the menu bar location. Also the side corners of the window should not be a rectangle, it should ...

RTFEditorKit save Images

201 byte By roli8200a at 2007-9-30 1:55:11
After reading a lot of posts and samples the main question stays already:IS THERE NO WAY TO SAVE IMAGES FROM THE RTFEDITORKIT?I really really need this function!!Please Help

The system is not showing the UI as soon as i opened the frame

312 byte By RajaniKanthAnupojua at 2007-9-30 1:55:13
Hello!I am writing an application in that on clicking on the Button another window will open. In that frame 4 buttons must b visible. I was not able to see untill i am pressing twice on the button. Can any one tell the reason for that problem.Thanks for any help.Rajani ...

Reusing Components

129 byte By zeldya at 2007-9-30 1:55:35
If I want the same label on 4 panels,is it a good idea to just create onelabel and add it to all the panels?

JTree updating error

720 byte By ahoheha at 2007-9-30 1:56:07
Hi to everybody,I have this problem: when I update the tree sometimes it happens that the JTree component displays a very huge (400 pixel) white space between two rows. The content of the tree is correct but there is one row that is very tall: it's only one row but very tall!! To update the ...

JDialog appearance

221 byte By rpatel44a at 2007-9-30 1:56:13
I've got a JDialog object (with Windows look/feel). The top right of the dialog box has an 'x' to close out. Is there a way to get rid of the 'x' so the user doesn't have the option of closing the box?

CHANGE JSCROLLPANE VERTICAL BAR COLOUR

98 byte By tlloretia at 2007-9-30 1:56:54
Hello!,do you know how to change Vertical Bar colour in a JScrollPane?Thanks!

hi all

320 byte By mcoonda at 2007-9-30 1:57:13
I got so bored of manually putting the components onto the Jframe that i decided to go the VB way ;)check out this http://omega.uta.edu/~mvn6491/gui.gifIf anyone of you want the source code. i would be ready to share it with the person who requests for the ...

no_gui

311 byte By htundera at 2007-9-30 1:57:16
hello!i have a big probem,...i have written a program which should run with no gui, but i'm still using the gui(if i start this in the console there is an exception, because i have written class myclass extends jframe...)how can i get very easy an nogui ...

JTABLE + RESULTSET

8007 byte By longieDITa at 2007-9-30 1:57:24
Hello,I have a result set which needs to populate a jtable - i can get hte headings but the actaul content is not showing or else coming up with with 'ClassCastException'Any help is appreciated.Regards,Longieimport javax.swing.*;import javax.swing.plaf.TableHeaderUI;import java.awt.*;import ...

BorderLayout

259 byte By lks_plma at 2007-9-30 1:57:34
hi,Border Layout consists of five areas (north,south,center,west,east), i wantto know how to set or adjust the height of each area because when i create a textarea in the "south" area, seems that the height is too small..how to solve this?thanks

Problem with JScrollPane

816 byte By TechnoSpike_1a at 2007-9-30 1:57:43
Hi! I'm having trouble with using JScrollPane and I would apreciate some help. I'm trying to do the following:I have an object that extends JPanel (TestPanel) and in this object I draw some Strings and some graphics. I'm trying to set this object as the viewPort for a JScrollPane in a JPanel ...

Virtual text browser

357 byte By sbernstea at 2007-9-30 1:57:45
I need a scrollable non-editable text browser to display text that can be computed on the fly. The text is too big to fit in the virtual machine, but it has a knownnumber of lines, each line contains the same number of characters, and each line can be computed on the fly given the line number ...

Printing JTable with DefaultTableCellRenderer (or JLabel's)

680 byte By rene_petersa at 2007-9-30 1:58:13
Hi there,I am trying to print a JTable by having it implement the Printable interface. It works, but it works only because I use the string values from the renderers of the cells. This works fine if its just simple left alligned strings. But when you are using formatted text strings for ...

whiteboard

424 byte By peter_dublina at 2007-9-30 1:58:27
Hows it going, just want to save what i have on a white board to a file, just freehand lines.i store the co-ordinates in an object and place all the objects in a vector.should i just write the vector out to a file or is there another way of saving the whiteboard to a file?a way that microsoft ...