RE: how to resize the components in JFrame dynamically
Try to use Layout managers like BorderLayout,Flowlayout..It will take care of the location -Original Message- From: Hari Ram Bathina [mailto:[EMAIL PROTECTED]] Sent: Monday, January 15, 2001 3:34 PM To: [EMAIL PROTECTED] Subject: how to resize the components in JFrame dynamically hello all, I have a situation where my user's screen resolution will vary from a laptop to a 17" screen. How do I code so that my JFrame with 2 text-fields and 3 combo-boxes etc are sized based on the screen resolution? I hope I made clear my problem. Thanks in advance, hari _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. ___ Swing mailing list [EMAIL PROTECTED] http://eos.dk/mailman/listinfo/swing ___ Swing mailing list [EMAIL PROTECTED] http://eos.dk/mailman/listinfo/swing
Logging in Java
Hi all: I have created a front-end user interface in Swing which communicates with the middleware server. Till now I was using "System.out.println()" statement for debugging but since we have to ship the product, I have to remove all the print statements and instead log all the messages in a log file. Can u guys give me a headstart as to what I should do ??? maybe some link or piece of code which will help me get started. Cheers Harry ___ Swing mailing list [EMAIL PROTECTED] http://eos.dk/mailman/listinfo/swing
System Clipboard
Hi all I have an application in which I need to copy some data into the clipboard. This data is a part of the string: "key1=value1|key2=value2|key3=value3". So basically I want to copy "value1" to the clipboard. I have a String Tokenizer on "|" and "=" The strange part is that it shows me a different value "key1=v" in the clipboard. So when I try to paste this into the same swing application, I get the desired value "value1" but when I try to paste it in NOTEPAD, I get "key1=v". Is that possible ??? Different values from the clipboard for 2 different applications. Following is the code...Please give it a try and see the magic for yourself. Please Help Regards Harkishin //CODE import java.util.*; import javax.swing.*; import java.awt.datatransfer.*; import java.awt.*; import java.awt.event.*; public class screenpop { public static void main(String[] args) { String data = "key1=value1|key2=value2|key3=value3"; StringTokenizer st = new StringTokenizer(data,"|="); //to separate the tokens starting with "=" and "|" int count = st.countTokens(); //get the count to initialize the size of the array String[] arr = new String[count/2]; int i=0; String str = ""; while (st.hasMoreTokens()) { str = st.nextToken(); //don't store the keywords arr[i] = st.nextToken(); //store the values in a String array System.out.println(str + " = " + arr[i]); i++; //get the next keyword, value pair } Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard(); StringSelection ss = new StringSelection(arr[0]); //Copy "value1" to the clipboard cb.setContents(ss,ss); System.out.println(arr[0] + " copied to the clipboard, press edit paste or cntrl + V in notepad "); } } ___ Swing mailing list [EMAIL PROTECTED] http://eos.dk/mailman/listinfo/swing
RE: multi-lined labels?
Use HTML Example: html line one br line two /html -Original Message- From: alex [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 05, 2001 1:36 PM To: [EMAIL PROTECTED] Subject: multi-lined labels? Is there a way to create a JLabel with text that breaks across multiple lines? Thanks, -alex __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/ ___ Swing mailing list [EMAIL PROTECTED] http://eos.dk/mailman/listinfo/swing ___ Swing mailing list [EMAIL PROTECTED] http://eos.dk/mailman/listinfo/swing
RE: multi-lined labels?
He Greg: thats sounds like a good idea...Can you throw some light on the JTextArea method ??? Regards, Harkishin -Original Message- From: Greg Munt [mailto:[EMAIL PROTECTED]] Sent: Friday, July 06, 2001 5:30 AM To: Harkishin Nachnani; alex; [EMAIL PROTECTED] Subject: Re: multi-lined labels? Erk. A better solution (IMO) is to extend JTextArea, and give it the look and feel of a JLabel. The HTML solution seems kinda hacky to me - different OS's give different font sizes, etc. I just don't like it that the line break is hardcoded, and prefer Java to decide for me. The HTML solution also depends on the window staying the same width, etc. -Original Message- From: Harkishin Nachnani [EMAIL PROTECTED] To: alex [EMAIL PROTECTED]; [EMAIL PROTECTED] [EMAIL PROTECTED] Date: Thursday, July 05, 2001 08:05 Subject: RE: multi-lined labels? Use HTML Example: html line one br line two /html -Original Message- From: alex [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 05, 2001 1:36 PM To: [EMAIL PROTECTED] Subject: multi-lined labels? Is there a way to create a JLabel with text that breaks across multiple lines? Thanks, -alex __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/ ___ Swing mailing list [EMAIL PROTECTED] http://eos.dk/mailman/listinfo/swing ___ Swing mailing list [EMAIL PROTECTED] http://eos.dk/mailman/listinfo/swing ___ Swing mailing list [EMAIL PROTECTED] http://eos.dk/mailman/listinfo/swing