JTextArea setColumns display issue

1309 byte By tristen_ea at 2007-9-30 1:58:46
Hello allIt seems when I use the setColumns(n) method of JTextArea then only the first line of the JTextArea is being displayed. The work around (please refer to the following code) is to execute pack() twice.If I execute pack() once, then only the first line of the 10-column JTextArea is ...

splash screen does not display correctly

795 byte By devesh67a at 2007-9-30 1:58:52
Hello everyone. I have a class which shows a spashscreen. When run from the main method it display the splash correcly. I have a login module. When the login is sucessful , I call the splashcreen module. Here the problem arises. It just gives me the white background. The image is not there. ...

Swing Layout Opinions

937 byte By riches85a at 2007-9-30 1:59:10
I have talked to several people lately about how hard it can be to layout components in swing so they are just the right size in the exact location you want them too. I was told by one person that GridBagLayout offers you the most power at the cost of complexity. A friend also said that he ...

Background image of a JRadioButton

224 byte By joape382a at 2007-9-30 1:59:21
I have created a JApplet with an image as background. I also placed JRadioButtons in the applet but they were created with a grey background. Can you set the background of a JRadioButton? If you can, how do you do it?

JTextField focus problem

1896 byte By joape382a at 2007-9-30 1:59:24
I have a problem with JTextField focus. Consider the code:class MyPanel extends JPanel {ImageIcon imageIcon;Image image;public MyPanel(Image tiledBackgroundImage) {setOpaque(false);setLayout(new BorderLayout());imageIcon = new ImageIcon(tiledBackgroundImage);image = imageIcon.getImage();}public ...

How do I get the Type?

260 byte By stoffhaia at 2007-9-30 1:59:41
Hi there!I've got a little problem.I have a JTree and I want to find out, what type my selected object has, for example *.xml, so I want that it gives the String xml back.How can I get to this information?Thanks for helping!

get ComboBox Items

120 byte By MohamedEilwaa at 2007-9-30 2:00:09
Dear All,is there a manner to get an array of all the items included in JComboBoxThanks in Advance.

Setting Preferred Size of JTextField

553 byte By Bernie-wolfa at 2007-9-30 2:00:14
Hi GuysI am having a problem setting the preferredSize of a JTextField, no problem setting max or min size. The problem is for example I want - width = 78 & height=18, call setPreferredSize using these values, check the size and it is width=1100 & height=18 The class structure is as ...

how to receive color from look and feel?

275 byte By _P@trick_a at 2007-9-30 2:00:29
Hi *--I like to set a color according to a color that is already defined in the UI. More precise I like to get the color that is used for selection (defined with the look and feel). How can I get this color?Thanks in advance!Cheers, Patrick

JTree

142 byte By BinoMMadhavana at 2007-9-30 2:00:49
I have to search for files having specific extension.After getting folders ant subfolders i have to create a JTreewith this.Pls Help me

Showing HTML in JTextArea

320 byte By Simple@javaa at 2007-9-30 2:01:01
Hi foks, anybody as any idea on how to show HTML page in a JTextArea. I could show the HTML as text, but want to view it in JTextArea same as we can see an HTML page in a browser. If the way of doing this is other than using JTextArea, pls let me know. Thanks in advance, ...

GridBagLayout and textfield

609 byte By per_claesona at 2007-9-30 2:01:21
Hi im having a big problem with gridbaglayout and text field.The main issue is how to set a fix length for a textfield in a gridbaglayout.This is a example but not the whole reallity for my app but answering it, will surly help me. yx 0 1 2 0| label | textfield | empty|1| table|The thing is how ...

picture not loaded in splashscreen

202 byte By devesh67a at 2007-9-30 2:01:23
Hi the problem of splash not displaying only arises whem called from anther class. When run run from the main method no problem arises. This is what i don' understand. U have an answer?

JGoodies

326 byte By riches85a at 2007-9-30 2:01:56
I have heard a lot of good things about setting up layouts using JGoodies. Has anyone heard of any disadvantages to JGoodies? For instance, is the code any slower? I was also wondering if anyone else has heard of any other third party alternatives that are used out there. Thanks for your ...

Tooltip - make it pop up

198 byte By codecraiga at 2007-9-30 2:01:57
Hi,I have a label that has a tooltip, and i want the tooltip to popup when I tell it to....how can I make the tooltip show up without user putting the mouse on the label?Thanks.

JTextPane: how to avoid word wrap?

697 byte By the.paula at 2007-9-30 2:02:15
Hi gurus,I have a JTextPane and I setted the editorKit to be a HTMLEditorKit doing:textPane.setContentType("text/html");I tried the following:HTMLDocumenthtmlDoc = (HTMLDocument) textPane.getDocument();HTMLEditorKithtmlKit = ...

Update to graphics only working when maximise window

1018 byte By RodBeechera at 2007-9-30 2:02:18
Hi folks, I'm trying to put together a java application but have run into trouble with a JPanel that displays graphics.The JPanel is inside of a JScrollPane, which is itself inside of a larger panel in the main JFrame. The JPanel inside of the scrollPane displays some graphics depending upon ...

icon

194 byte By lks_plma at 2007-9-30 2:02:30
just wantto ask, to create a JButton with image, where do i need to put the .gif file?is it same folder as my program? cause when i run it, there is not image appear on the button.

Display time in real time!

540 byte By pateldwa at 2007-9-30 2:03:20
Hi Im trying to display time in my program!Im using this code?!Date today;String dateOut;DateFormat dateFormatter;{dateFormatter = DateFormat.getTimeInstance(DateFormat.SHORT);today = new Date();dateOut = dateFormatter.format(today);}I then attach the dateout to a textarea. Every time I write a ...

Formatted text and JTextPane

282 byte By Klamraa at 2007-9-30 2:03:52
Hi!Does anyone know how to fetch the whole text from a JTextPane as an AttributedString? It's easy to fetch the text as an unformatted String (with getText()), but how do you fetch the Attributes of the contents of the JTextPane or the corresponding AttributedString?

JWindow - create my own rectangle window

431 byte By codecraiga at 2007-9-30 2:04:17
hi,I am creating a class that extends JWindow, and i want to make my own rectangle, instead of the standard JWindow rectangle.....that appears when you "show" the JWindow.if I override the paint method...how can I change the rectangle that appears? It may seem pointless why I am doing this, but ...

How to modify the JWindow window

312 byte By codecraiga at 2007-9-30 2:04:27
I need to modify the actualy window created when creating a JWindow...for ex:JWindow window = new JWindow();window.setLocation(0,0);window.setSize(100,100);window.show();I want to modify the window that appears when show is called....any ...

JFrame minimizing problem

261 byte By javanuia at 2007-9-30 2:04:34
I am writing an application where i have many JFrames on the screen at the same time. The problem is that when i click on a menu item in one of the screens the rest of them get minimized. Is there any way of preventing this without using JInternalFrames.

Enlarging fonts with Swing

1709 byte By Eric_Buista at 2007-9-30 2:04:36
For a long time, I was looking for a way to get larger fonts with Java applications. With AWT, it seems necessary to modify the source code of the application to create larger Font objects. With the use of Pluggable Look and Feels, I thought Swing did not suffer from this problem, but ...

Frame display

340 byte By mtacoEasta at 2007-9-30 2:04:39
I am having problems runnning Java applications on some machines,I have found my programs hang at the point where I call this methodsetVisible(true);It never returns from this method.I am working with touch screen mointor and dont know if tht is an issueHas anyone ever had this problem with ...

JWindow

127 byte By codecraiga at 2007-9-30 2:04:41
How to make JWindow always stay on top....meaning, when click on different window my JWindow stays on top.thanks.

Printing

127 byte By @rmingjsda at 2007-9-30 2:04:56
Hi there!!I'm just trying to send a some large BufferedImage to printer, can you help me please?Regards!!

scale and guideline in jtable

320 byte By mischka24a at 2007-9-30 2:04:57
hi.for displaying data in a grafhical way i need specific scales in my jTable's columnheader. i also want to realize some sort of "guidelines". do i have to use the java 2d api to draw the guidelines? is there any example out there? anybody who had the same problem?thanx for any ...

Menu bar action events

534 byte By whatstherusha at 2007-9-30 2:05:05
HiI have a program that has menu bar actions, one of these actions uses an integer array that was initialised and filled in another method in the class. The array is private variable of the main class. I have an actionperformed method that is used to detect any events from the menubar. When the ...

Why label is not showing?

1191 byte By codecraiga at 2007-9-30 2:05:06
Hi,I have a class that extends JWindow....but when I add label, i cant see the text..public class myWindow extends JWindow {public myWindow() { setLocation(100,100); setSize(200,200); JLabel label = new JLabel("My label");getConentPane().add(label);}}public class testWindow {public void static ...

Lag problem with JFileChooser

723 byte By deraguna at 2007-9-30 2:05:18
I have searched the archives and haven't found any useful information regarding the fact that creating a JFileChooser lags horribly on some systems...namely mine. I have tried running my own program and the FileChooserDemo on java versions 1.4.1_02, 1.4.1_06, 1.4.2_01-b06, and 1.5.0 beta and ...

mouse icon problem when resizing frame

407 byte By sushika at 2007-9-30 2:06:06
I have a problem where the mouse icon stays as a resize icon and doesn't change back to the default icon after the resizing is finished. I have been experiencing this problem ever since i started to use a L&F i created. the thing is, the L&F doesn't touch the mouse definitions and ...

physics equation editor

358 byte By xiejavaa at 2007-9-30 2:06:30
hi, I have a task to make an applet which could editor add, deduce, multiply and divide, integral and differential coefficient, vector, etc. Then to make it as some string to transfer to servere. I do hope other could use it gives a physics and math representation. No need for calculation. How ...

GridBagLayout Null pointer exception

5231 byte By ap0kalyp53a at 2007-9-30 2:06:36
this is my first time trying to use a gridBagLayout and i haven't been able to get it to execute yet. if anyone spots what's wrong i'd really appreciate it. It keeps throwing a null pointer exception when it gets to the import javax.swing.*;import java.awt.event.*;import java.awt.*;public ...

dynamically altering components within a GridBagLayout

1364 byte By iamstylesa at 2007-9-30 2:06:38
Hi:I've got a new application feature that i'm looking to implement. From user input, i'm lookingto trigger a method that would take an existing GridBagLayout set of components and to addand later subtract swing items from the layout manager. Basically, i'd look at something likevoid ...

JTree

167 byte By BinoMMadhavana at 2007-9-30 2:06:45
I hava string[] like {c:\java\test;c:\java\test1;c:\data;c:\data\data1\data2\}With this i have to create JTree with exact order.give me some code.

Exception in native code outside the VM

1572 byte By Maverick2004a at 2007-9-30 2:06:59
My Java environment :java version "1.4.2_03"Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02)Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode)I was about to start the development of a swing project when I tried the follwoing code just to check the Java installation ...

ListCellRenderer with JComboBox

1712 byte By hupfdulea at 2007-9-30 2:07:27
Hi,I tried to implement a custom ListCellRenderer for a JComboBox:public class StatusComboBoxRenderer implements ListCellRenderer {JLabel label;public StatusComboBoxRenderer() {super();this.label= new JLabel();}public Component getListCellRendererComponent(JList list,Object value,int ...

Replace all

1007 byte By lks_plma at 2007-9-30 2:07:32
Hi there,i got this codes online for replacing a word in textarea . The problem is it only replace the first word it match, while other same word still remain un-replace.how to modify it so that it can replace all the particular words that i wantto replace in the textarea.Document doc; ...

Urgent!!! cut function in JTextArea is not working

528 byte By ijaazatha at 2007-9-30 2:07:43
In my project, I am using a JTextArea. To remove a particular text in text area, i was selecting the text and I was using cut() function to cut the selected text. This functionality was working fine when I was running the the project on JBuilder. But when I run the same without using JBuilder( ...

Determining if component is displayed in JViewPort

381 byte By Elefanta at 2007-9-30 2:07:44
Hi!I have a JScrollPane where I have added an image with buttons on it. Is there a simple way to determine a specific button is inside the JViewPort, i.e. the user can see it? I know I can calculate it using the JViewPort.getViewRect() and the button's position and size, I just wonder if there ...

jtable cell renderers paint() or print() method don't work?

746 byte By rene_petersa at 2007-9-30 2:07:47
I have been trying to use the paint(Graphics g) and print(Graphics g) method on a renderer to print it. I couldn't get it to work (nothing gets printed). I would like to see it work e.g. for checkboxes. I have been able to print a table by using its print method, but by using that one I loose ...

Event Handling...advice

998 byte By zehda_a at 2007-9-30 2:08:10
Hi, I'm coding up a GUI application and i need to handle many ActionEvents and other events too. What i'm doing now is having my top level class implement the ActionListener and then making 'this' the action listener for all my action events. When it comes to knowing which component fired ...

Change text color of an HTML page inside JEditorPane

991 byte By seawana at 2007-9-30 2:08:19
Hi Gurus,I need to change the text color of an HTML document in my JEditorPane, i.e., update a certain text string's background color dynamically. It works OK when I first run the following function:void changeColor(AccessibleEditableText at, int start, int end, Color color){SimpleAttributeSet ...

JTextPane auto-scrolling randomly failing

1720 byte By danigarridoa at 2007-9-30 2:08:21
Hello everyone,In an applet, I have a JTextPane with a StyledDocument in it as a viewport for a JScrollPane. This is a conversation chat window, so I want that, whenever a new message arrives, the vertical scroll gets automatically to the end of the document.I've tried it in *lots* of ways, ...

insertString() in PlainDocument not working

1163 byte By santunupa at 2007-9-30 2:08:32
Hi ,I am over riding the insertString() method of PlainDocument class.In this method, I aim to insert the string only to a permissible length, beyond which the method should return.Well, this method works, if the string is entered character by character.But if the user pastes a string(of ...

JTREE CUSTOMIZED

165 byte By tlloretia at 2007-9-30 2:08:44
Hello everybody!do you know how to change + and - icons in a JTree?and how to eliminate lines in a Jtree?Thanks in advance!Tlloret

JTable and DataBase

4052 byte By Follyaxela at 2007-9-30 2:08:49
Hi,I'm getting my information out of a database into a result set and then into a table....This code is working fine... but I don't think this is the easy way to do this....Is there a better way to get what I wan't or is this really the way to do it.This is my code:package ...

setToolTipText not working within method?

825 byte By johnnyhall81a at 2007-9-30 2:08:54
Is there any reason I am getting this compilation error regarding setToolTipText( )?[COMPILATION ERROR]cannot resolve symbolsymbol: method setToolTipText ( java.lang.String )location: class java.awt.Componentcomponent.setToolTipText( t );[/COMPILATION ...

Subset of JTable?

466 byte By rene_petersa at 2007-9-30 2:08:56
Hi there,I am trying to print a JTable. Because it doesn't fit on the page I would like to get a subset of the JTable (e.g. coloms 2 .. 3 and rows 15 .. 35). I know all the data is in the tablemodel, but i really would like a subset of the table since this one also contains all the information ...