963 byte By
d.busa at 2007-9-30 0:37:52
Hi experts,i'm working on a text editor using JTextPane with a HTMLEditorKit and a HTMLDocument.whenever i apply a style (e.g. bold, underline ....) using the method setCharacterAttributes in either JTextPane or in the HTMLDocument, the selected text is being changed to bold, underline ... BUT ...
382 byte By
IloveCAa at 2007-9-30 0:38:44
Hi , I'd like to set the buffer size which user can input not to be attacked by buffer overflow on the JTextfield or JFormatedTextField. For instance, I'd like to set the MAX buffer size of jtextfield 256byte. At first, I tried to setcolumn(). But it seems to set the visible size on them.Any ...
3749 byte By
MSashaa at 2007-9-30 0:38:49
Hi guys,I have got a silly probleme, that I had never had befor. I trying to develop a game DOTS. a two player game.Each player clicks on a dot in turn. The first player makes a dot red, the second player makes a dot green. and so on.... because I have stopped at this point:). I cant repeint an ...
Hi,I got problem. I do not know how to retreive the DefaultMutableTreeNode from Treepath.Thanks
646 byte By
tune993a at 2007-9-30 0:39:10
I have added a new DefaultMutableTreeNode, as follows, to a JTree:DefaultMutableTreeNode root;jTree = new JTree(root);DefaultTreeModel treeModel = new DefaultTreeModel(root);DefaultMutableTreeNode node = new DefaultMutableTreeNode();treeModel.insertNodeInto(node, root, root.getChildCount());now ...
704 byte By
zehda_a at 2007-9-30 0:39:30
Hi, I'm using JFormattedTextField to read in user input. The input needs to be a valid 5 digits number so i used DecimalFormat and NumberFormatter to put restrictions on the input, and i set the setAllowsInvalid() to false. The problem i'm having now is that when i type in some number and ...
For a particular project I'm working on the specs say that as a user types a value into a particular cell in a table, I must validate that each character is valid and that they are typing a valid code.Example: Say valid codes are "01", "02", "10", 11", "20", ... we actually have a large number ...
I have a blank JTable that will add rows as the user clicks the "add rows". My dilemma is some of the objects in the rows are comprised of JCheckBoxes. I need to know how to create an actual checkbox in those spots, without creating a sublass the extends DefaultTableModel. Also i can get ...
Hi, I'm developping a game tool in which I'm using a JScrollPane containing a JPanel for which I have redefined the paint(Graphics) method.In order to have the fastest possible rendering, I have disabled the double buffering and defined my panel as opaque.My panel is drawed twice when the ...
Hi,I have a question with regard to the table cell renderer.I have a table with 8 columns .. and the last three columns I have set the renderer to bea Price cell renderer.. which takes a double value and displays in curreny format.$10,000.00..... This works fine ... when I ...
Hello AllIs there a way we can wrap the text in a JLabel. Im dynamically rendering the components on a form, so if the Label Text is too long the frame gets ugly, Im using Gridbaglayout to layout the form components. Is there a way I can wrap the text in JLabel, so that I can get a neat look ...
Hi, I齰e a JTable and need to be notified when a row(or cell) is selected so I can call an specific procedure when a row is selected. I dont know how?I have an AbstractTableModel extended for the table data managing...Anyone could help?Thanks.Al
180 byte By
SIJPa at 2007-9-30 0:41:42
Hello.I am working on my current project look and feel, and I would like to make my JPanel's Background gradient.is that possible? and if so , how do I do it?
Hi, I am using JLabel and Image Icon to view images. However, the image processing I am doing invovles bitmap files, but Java recognizes only jpeg, gif or png. Is there some functionality available to use bmp instead?Thanks,SB
I am having a problem navigating a menu IF a JButton has the focus.To reproduce the problem:Tab to a button so it has the focus, then do a Alt-F to activate my menu (which has a File menu), then try to use the arrow buttons to navigate the menu, I can't. Pressing escape doesn't work either. ...
Dear all,I've problem of refreshing JEditorPane using setPage( ) method.I've written a simple JAVA browser with an analysing system. When a user clicks a hyperlink, the setPage( ) method will be called. Followed by the setPage( ) method, is another method, called method2, used to analyse the ...
HelloI am in the process of going through some Java tutorials and am stomped with this excercise and was hoping someone could take a look at it and direct me down the proper path of correctness and knowledge.This is supposed to be a very simple password applet, but has become a mind-bender for ...
i ma havign a problem. i have a combo box, and when i use the keyboard to navigate tothe choice i wnat (by pressing the down arrow) i catch an ActionEvent every time the selection changes. this does not happen when i use the mouse to mouse over hte choices.the Topley book i have sugesssted ...
603 byte By
tanmaoa at 2007-9-30 0:42:40
I am implementing a function that is similar to the code completion of NetBens IDE.I used the BasicComboPopup class to do this but have some problems:1. Up and Down Arrow Keys don't work with the BasicComboPopup. this is the same problem posted by acj777 on Oct 14, 2003 but it seems he had not ...
846 byte By
AR2004a at 2007-9-30 0:42:49
Hi all,I'm trying to create a JScrollPane with multiple components in it, inside a TabPane. However I keep running into problems getting the display working.The contents of the ScrollPane will be determined at runtime and will consist of "n" tables and JLabels, in no particular order. The only ...
Hi,Is it possible to set a JInternalFrame to be modal on my JDesktopPane similar to the dialogs created by JOptionPane.showInternalMessageDialog()?CheersStu
150 byte By
771003a at 2007-9-30 0:43:28
Hi! How do I override the default functionality of JOptionPane from Space key to Enter key when OK or Cancel button is in focus? Thanks.
2090 byte By
PervBoya at 2007-9-30 0:43:29
Hi Guys,I am at my wits end as to how I can solve this. I really can't find a solution, I hope you can help.I have a gui layout thus:JTabbedPane -> JScrollPane -> JPanel -> JPanel (instead of awt.canvas)I have multiple java2d 'graphs' that I wish to layout on this scrollpane left to ...
I am writing an application where I called a window to be opened. That worked out fine, and as of now the program runs as it should. But I want to open up another, different window. I made this panel in my own class, but how would I write another class for a new panel.?import ...
165 byte By
cyshanga at 2007-9-30 0:43:35
Hi, I have a JTable in scrollPane. I would like to know how to make the focus to a particular row (even the row may be not in the current scroll page).
Hi all,I have queries regarding saving and loading JTree profiles. The idea is that i can create trees and save the different trees into text files. The next time i want to use them i can just click a load button, select the tree profile i want and load it onto the treePanel.i was thinking ...
I'm new to Java, but was hoping someone could point me in the right direction for populating a menu with items as it is about to be displayed. This would be a cascading menu off a JMenu off a JMenuBar. I have figured out how to populate the JMenu, but don't know which hook to use to get ...
466 byte By
GScharfa at 2007-9-30 0:44:26
If the user presses the close button on the title bar of a JDialog, Swing generates a WINDOW_CLOSING event as part of the window closing process.How can I cause this to happen programmatically? I want to emulate the user's pressing the close button with normal Swing processing, including the ...
Hi ,I have a heavy GUI apps that works fine on jdk 1.3 . But when running it uding jdk 1.4 , it gives stackOverFlowError. why is that so ?ThanksTarun
Hello,I wish to Create this for college system with multiple desktops with seperate menus for each subsystem to keep things tidy is this possible.I would like to have a Floating Toolbar that can set the view to a new functionality.I would like to start with two different functionalities with ...
HiI have a JTable containing data in a spreadsheet . For the JTable I have registered a popu menu which contains a number of actions the actions are also registered with thte table using its inputmap and action map. This allows the user to invoke tasks either using the popup or using keyboard ...
I am just wondering why JComboBox has been implemented such that setSelectedItem( Object anObject ) makes "anObject" selected instead of the object being looked up in the model ?It doesn't really make sense to me.Aron
370 byte By
sheawha at 2007-9-30 0:45:42
I am trying to get information (x,y location) of a JLabel from Database.each time, I new a JLabel, and the I call setLocation(x,y), But the JLabel doesn't go to the specific location,I used jbuilder to debug, I found that the (x,y) are correct, but the JLabel cannot update the location ...
hi, i'm trying to setup a basic gui with swing that can show multiple languages at the same time. however, i've run into some problems. i can display english and most european text it seems, from a simple font/text test program i've downloaded that displays multiple hello world in different ...
I have a serious problem with TitledBorder(jPanel) Here, I have two class the first it contains a jTabbedPane ( class_jTabbedPane)qui call the second which contains a jPanel (Ptableau) which contains a jTable in a jPanel with TitledBorder The problem that one I carry out the jPanel with the ...
Hi am using a JTree to construct a tree from the database. I would like to be able to add open and closed folder icons to the tree. I know the JTree does this automatically but I need more control over what icons are displayed and when.However I can not seem to find these folder icons anywhere, ...
1255 byte By
gurdza at 2007-9-30 0:46:39
Hi All,I'm unable to make that caret position go to a given line no in the JTextPane. I have tried to use setCaretPosition(int) but that seems to give me an error : (I want to set the position of caret to a given line no (i.e. where a method starts) I have got: public void goToLine(String ...
Hi,Where can I find these "secret" JSlider properties? I just found out about the isFilled property....for exampleputClientProperty("JSlider.isFilled", new Boolean(true));where can I find these things out ahead of ...
Can some one help me figure out how to get a frame to open ferom a button with input. here is the source code where it would be used. // Programmer:AISC AM Programming class// Jan. 22, 2004// DiseaseSim2 driver to test out People classimport javax.swing.*;import java.awt.*;import ...
1363 byte By
RAPHEADa at 2007-9-30 0:47:01
Hi,I ran into serious problems with a small swing app:I have a jframe derived class with the following method:public void quit(){if (licenceServerClient.isLicenceValid()){licenceServerClient.loadingStage = 0; // Reset loading stageProgressMonitor progressMonitor = new ProgressMonitor(this, ...
hello, does anyone else out there wish for a variant of JTabbedPane.addTab() that looked like this?:public void addTab(Component tab, Component body); with such a method, one could pass in a jlabel for the tab component and therefore have complete control over the placement of the icon (and ...
Hi all,I am using the following method to change the look and feel of my application to my default (Windows). But my JComboBox remains in Metal. Has anyone else encountered this?[CODE]public static void setNativeLookAndFeel(){ ...
I am writing a program that involves drawing a shape, and moving it in a predetermined path around the screen. The implementation involves repainting over and over. Thus, there is some flickering and I have noticed that the speed seems to vary on different systems even though I have set the ...
I came across this problem which i would like you to look at. I really dont know if it is just a problem with my CPU or with every other AMD 1600+ XP.The problem is that, as the Intel Pentium had some numeric problem of the following calculation:4195835-((4195835/3145727)*3145727)and well if i ...
1669 byte By
mekane8a at 2007-9-30 0:49:21
Sorry if this has already been brought up, but the advanced search features didn't work and I didn't see anything like this in the first couple hundred results that came up for "JInternalFrame".Here's what I've got:I'm working on an app (Using J2SE 1.4.2_01) that uses a JTabbedPane with ...
Is it possible to put a cell editor on a Jlist ?I know that i can use a JTable and rendering it like a JList but in my case I prefer use a JList.Thanks.
2269 byte By
GeoJona at 2007-9-30 0:49:53
Based on the swing tutorial section on the event thread and swing, I was under the impression that I wouldn't have to use invokeLater if I was operating in the event thread and that events like focusGained would execute in the event thread. However, in the following code, if I comment out the ...
I can't get the cursor to come up on my text field. Every time I set the text of the JTextField, I lose focus and cannot regain it.public synchronized String updateMain(String displayUpdate){mainDis.setText(mainDis.getText().concat("\n"+displayUpdate));try{wait();}catch(Exception ...
329 byte By
cocoha at 2007-9-30 0:50:50
Hello All,I am looking for an error dialog that can be expanded and contracted to show/"un-show" the details of the error. Is there such a class? I havent really been exposed to the swing api until recently. i need some sort of guidance.Any help is appreciated. Thanks.Best ...
Greetings, I am trying to launch Java Applications or Java Applets (mainly applets) from within my Java Application.... I was thinking about using a JEditorPane and launching Java Applets from that since it supports HTML, but the JEditorPane is not a Java compatible browser. Does anyone have ny ...