Font prb in swing component
Hai all
i suspect this may not be the right place for the post!!! (if not inform me the right place)
frankly i need urgent help...
i have a GUI application. that has to display Indian Language text. the font has glyph code sequence from 32 to 254. but
some glyphs are having out of sequence numbers. like after a glyph sode 126 there is 8221. most of the applications have
no problem displaying. i.e., some how they seem to map 127 to 8221. but the java GUI is not doing it instead it displaying a
box. some body pl help me. its urgent for me. i tried mapping 127 to 8221 but no help!!!!
anticipating early reply
This is probably the right place for your question.
i have a GUI application. that
a GUI application. that has to display Indian Language
text. the font has glyph code sequence from 32 to 254.What do you mean by "glyph code sequence"? Are these code points for an indian code page (character set)? You should be aware that Java deals with characters internally as unicode, so when you read characters into memory from a stream of bytes (on disk, for example), you either specify a character set to be used to interpret those bytes, or your system's default character set will be used. In either case, the values of the code points in memory will be in unicode, and could potentially be different than the code points of the original character set. This is normal -- do not try to remap the code points.
As long as you're using Swing components with a font the characters in your language, the characters should display properly. I have experienced problems using AWT components. There is a bug in the Sun database which says that AWT components do not support unicode, so stay away from AWT (http://developer.java.sun.com/developer/bugParade/bugs/4363326.html ).
Good luck, and let me know if you have any more specific questions.
Similar Messages
-
Help-using document as a java swing component
Hi,
can i use a document excel file or a doc file as a swing component.
i have few templates in in excel and .doc format.
i use them to produce bills by just entering data.
Now i want to develop a swing application and use the same templates in jpanel or jtextpane or jeditorpane.
its very hectic to make templates in swing using tables and all.
is there any api which can help me out???
thanksas a Swing component? No.
There's probably libraries for reading those types of files, and maybe displaying them. POI, perhaps? -
Swing component's margin in a frame
Hello all,
When you set the bounds of a Swing component in a frame, it will automatically apply those bounds to the VISIBLE part of the frame, so that, a Y value of 0, for example, will not be at the very top of the frame, but right underneath the title bar of the frame. If you give a regular AWT a value of 0 to it's Y coordinate, part (or all) of it will be covered by the title bar of the frame. This does not happen with Swing components, which automatically add the height of the title bar to the value you give to their Y coordinate.
Now, what I want to know is, how can I retrieve the value of that "automatic margin"?. How can I know the number of pixels that the Swing component is being slided down, in order to save the title bar of the frame? This value can not be constant, since it will differ from one platform to another, and from one Look 'n Feel to another, but I have not been able to find out the way to get the value that it's being applied in each case.
As allways, many thanks in advance for your help.Don't know if there is any direct way to get this information. But, assuming the border width/height is equal on all four sides you could try something like:
Dimension frameD = frame.getSize();
Dimension contentD = frame.getContentPane().getSize();
int borderWidth = frameD.width - contentD.width;
int titleHeight = frameD.height - contentD.height - borderWidth; -
How to set a Swing component as Modal window on a SWT Component.?
How to set a Swing component as Modal on a SWT Component.I mean, I have a window (SWT Container) with some menu items.
When I click on one menu item then i will get one new Swing Window.
When creating the new frame I had passed Modal value as TRUE in the constructer.Now child is not behaving as Modal Window.I mean I am able to go to parent window even though the child window is opened as a Modal Window.This is only happened when I double click on the Title Bar of the Parent Window.
If I try to click on any other part of the Parent Window except Title bar ... the child window is working as a Modal Window.
Can any one suggest me to solve this one !!int this case, do this :
JFrame f = new JFrame("Authentification");
f.getContentPane().setLayout(new BorderLayout());
f.getContentPane().add(myJPanel, BorderLayout.CENTER);
f.setBounds(x,y,w,h);
f.setVisible(true);
Where myJPanel is the Panel you developped. -
How to set a Swing component as Modal on a SWT Component?
How to set a Swing component as Modal on a SWT Componen?.I mean, I have a SWt Component window and from that window I am displaying a SWING Component Modal window.
The problem is my swing window is not working as Modal always.
When I opened the swing window from SWT window,swing window is working as Modal.But if Idouble click on Menubar or Title bar of the SWT Window then my Swing window goes back.If I click on any other part of the SWT window.. then once again Swing window is working as modal.
Can any one suggest me to solve this?
I think this is isuue related with Swing over SWT..pradeep.rajadurai wrote:
I want set the JTable as a background of jframe or jinternalframe , how it is possible One way that may work, you can always extract the image from a rendered JTable and then paint the same image into the JPanel that holds your components via it's paintComponent method, then added the JPanel to the app's contentPane.
give me simple pgmIs English your second language? Because if so, please understand that this demand can be taken by some as rude. -
Support for Multilingual Numeral Input in JTextField swing component
When the User Locale is changed from the regional & language options in the control panel and the standard digits are customized to a non Latin character set, all the windows applications adhere to the changes made. HTML also respects the changes in effect and displays any numeric values using the new character set, which are the national digits for many Eastern Locales such as Chinese, Arabic(Saudi Arabia), Urdu and many more. The JTextField swing component given by java, however, does not show any support to the new settings. Any numeric input is displayed in the Latin character set even when the input locale of the system is also changed respectively. Any text input for this case is correctly displayed in the desired literals and appropriate glyphs. However, unlike the AWT components, numeral input and display is not catered as per the user/developer's requirements. This behavior was first noticed in 2007, as far as i have found out, and was reported once again on the same thread in 2010. The thread is given below as a reference. No action or response has been taken. Kindly look into this matter and please let me know if this bug has been reported before and if there is any intent of providing a fix for it.
Reference: http://www.coderanch.com/t/344075/GUI/java/Multilingual-support-JTextField
Regards,
Aitzaz Ahmad
Software Engineer
SENSYSI too had an itch to reply with something like this
This is a sign of work well done!
The WD has so strong UI abstraction, that hides client-server nature applications almost completely. If you search forum, you will even find posts where developers try to upgrade value of ProgressMeter in <b>for</b> loop )
VS -
Swing component for awt.canvas
Hi,
Can anyone tell me the equivalent SWING component for awt CANVAS. I need it because i need to display only Images (nothing else) on it. If anyone can tell how I can do it.JPanel is the Swing-equivalent of java.awt.Canvas, but if you are just displaying images, you can use the JLabel class, which supports use of images as icons (see also ImageIcon class).
Mitch Goldstein
Author, Hardcore JFC (Cambridge Univ Press)
[email protected] -
Swing component fires an event to non-GUI code
Hi all -- this is my first post in forums.sun.com.
Question to get me started -
I have a Swing component that fires an ActionEvent. I would like that ActionEvent to trigger code that does not run on the AWT Event Queue thread (some code that will take some time without impacting GUI rendering performance.)
I know I could put that Event's action command into a synchronized Queue, and have a worker thread checking the queue and taking action when it finds a command there. Likewise, I could flag a volatile boolean as true, and have a worker thread check the flag and take action when true.
Or (and I suspect this is best), I could create a new SwingWorker thread right in actionPerformed().
Any opinions on what makes sense?pkwooster: Yep. That's what I meant.
As for the design pattern, Observer was the pattern I was intending to use (and have already implemented). Would anyone argue that another method is more efficient or "correct"?
My sample project is:
Business Object -> Main Dialog -> Embedded Dialog
The Main Dialog contains no business logic - just simple navigation events. The Embedded Dialog contains the real controls and reports any interaction using Swing events, which the Main Dialog picks up.
I then set up the Observer pattern between the Main Dialog and the Business Object. -
Make a PJC Swing component Modal?
Does anyone know how to keep a PJC that is a Swing component in the same focus as the form?
In other worsd, when you invoke a spell checker in MS Word the spell check window is in focus when the word window is in focus.
If a swing component is non modal then it can get lost in the shuffle. Is it possible to force a PJC to be Modal?
nullFor instance, it looks as though the calendarWidget is non-modal
-
Searching a calendar swing component
Hello friends.
I'm looking for a calendar swing component, to make a schedule aplication (like Outlook).
I found "Mig Java Calendar" (http://www.migcalendar.com/index.php) but it isn't free, i need one like this free.
Do you know someone free?
Thank you.And if you think, as I do, that a date picker is
standard component and should be part of the jdk,
please vote here:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=473
0041
-Pucethat is really helpful. I voted for it. -
How to call Ocx in swing Component
Hi i want to play Flash4 file xxx.swf in swing Component
JMF Api Supports upto Flash2 only i downloadled Flash4 player which is a ocx file .how can i integrate this ocx in swing Component
help me please
regards
Mahesh.BI have used the tool JacoZoom by InfoZoom (http://www.infozoom.de).
The tool can create JCWs (java callable wrappers) for COM and ActiveX objects.
If they are visual, you can create and display them within your Java app
either as AWT or in Swing.
In general, JacoZoom is the best tool I have found so far, it is my
favorite.
Sylvia -
My Swing component's style is changed!
Hi all. I am using Linux openSuse and from a week I see that my swing component's style is changed! JButton, JPanel, JMenu, JCheckBox and other have a different style and I don't know why... this is an example: http://img527.imageshack.us/img527/715/screen1lg1.png
How can I return on the original swing component's style? Please help :(Anybody can help me? :'(
-
Swing component to use as time editor
what is the Swing component that we can use to immitate clock component editor in windows?
you know, the list where you can select/edit hours,minutes seconds .... is it a JList
can somebody give a small example please
thanksRead the tutorial: [How to Use Spinners|http://java.sun.com/docs/books/tutorial/uiswing/components/spinner.html]
You will find some examples there. -
Problem in Swing Component (JComboBox)
Hello i've got one amazing problem in my Swing Component (JComboBox) while testing for Glasspane..
Please check this photo http://www.flickr.com/photos/39683118@N07/4483608081/
Well i used Netbeans Drag n Drop Swing so the code might be messing..any way my code looks like this:
My code looks like this:
public class NewJPanel extends javax.swing.JPanel {
/** Creates new form NewJPanel */
public NewJPanel() {
initComponents();
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jTextField1 = new javax.swing.JTextField();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
jComboBox1 = new javax.swing.JComboBox();
jCheckBox1 = new javax.swing.JCheckBox();
setOpaque(false);
jTextField1.setText("jTextField1");
jLabel1.setText("jLabel1");
jLabel2.setText("jLabel2");
jLabel3.setText("jLabel3");
jButton1.setText("jButton1");
jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
jComboBox1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
jComboBox1.setNextFocusableComponent(jCheckBox1);
jComboBox1.setOpaque(false);
jComboBox1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jComboBox1ActionPerformed(evt);
jCheckBox1.setText("jCheckBox1");
jCheckBox1.setOpaque(false);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(119, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1)
.addComponent(jLabel2)
.addComponent(jLabel3))
.addGap(51, 51, 51)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jButton1)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jCheckBox1)
.addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(115, 115, 115))
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(70, 70, 70)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1))
.addGap(15, 15, 15)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(jCheckBox1))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addComponent(jButton1)
.addContainerGap(93, Short.MAX_VALUE))
jComboBox1.getAccessibleContext().setAccessibleParent(null);
}// </editor-fold>
private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JCheckBox jCheckBox1;
private javax.swing.JComboBox jComboBox1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JTextField jTextField1;
// End of variables declaration
}For more help create a [SSCCE (Short, Self Contained, Compilable and Executable, Example Program)|http://sscce.org], that demonstrates the incorrect behaviour.
-
Resizing the wrapped swing component inside the javafx stage
I have a customized swing component & need to wrap it in javafx stage. But as & when the javafx scene resizes, I want to resize the swing component accordingly.
One way of resizing this is to scale the swing component. But is there any other way or layout to do it efficiently.
--Nitin PokalwarHello
<p>Let's have a look at this Forms PJC/JavaBean site</p>
Francois
Maybe you are looking for
-
BAPIs or Function Modules for Links between different Business Objects
Hi experts, I am accessing an SAP CRM 5.0 system from outside via remote function calls. I have the GUID of a business partner and would like to find other business objects that are related to this business partner. For example: - Which activities ar
-
Physically printing a report from Apex using BI Publisher
Hi, I know it is possible to generate and download a PDF (or any other format) in Apex using BI Publisher (Apex 4.0.2) But is it possible to physically PRINT a report in a specified printer? For example, the user clicks a button and the report comes
-
How to backup my files from a crashed 10.6.8 Mac?
Need help with my 10.6.8 Mac! It all started when I accidently kicked my power strip 2 days ago which turned the computer off. I have done this a million times before in the 3 years I have owned the computer, but it has never done this: when I start
-
Prompt with default date ( currentdate-1 and current date-8)
Dear all, I am creating an @prompt varaiable for Date . @Prompt('message','type',lov,Mono, free,persistent,default_values) Requirement is in Place of "Default Values" i need show currentdate -1 and currentdate-8 . Thanks suresh.p
-
Unable to transfer contacts/calendar from 2007 Outlook to my 3G iPhone
I have done everything recommended in the above article for advanced setting in Outlook, as well as reinstalling itunes. Bought Microsoft office 2007. 2nd week with this phone and not able to trasnfer the contacts, and I refused to go back to the 90'