Search Results

Search found 37239 results on 1490 pages for 'javax swing text'.

Page 73/1490 | < Previous Page | 69 70 71 72 73 74 75 76 77 78 79 80  | Next Page >

  • iPhone: keep text looking good after scale transform applied?

    - by Greg Maletic
    I'm applying a scale transform to a UIView that draws a number. (The number is literally being drawn with drawInRect; no UILabel in sight.) The scale transform makes the view smaller by quite a bit...say, 80% smaller. The resulting number looks a little "chunky". Is there a way that I can keep my text looking nice and anti-aliased, the way it's supposed to look? Thanks.

    Read the article

  • How to edit the first line in a text file in c++?

    - by tsubasa
    I have a text file looks like this : 100 50 20 90 4.07498 0.074984 37.1704 28.1704 20.3999 14.3999 48.627 35.627 .... I need to edit this file so that everything is kept the same except the first line, 3rd item. The ouput should look like this: 100 50 19 90 4.07498 0.074984 37.1704 28.1704 20.3999 14.3999 48.627 35.627 .... How can I do it in c++ ? Can anybody help me? Thanks, Hoang

    Read the article

  • (Free) Text editor on Windows with a folder view?

    - by Horace Ho
    I have to stay away from my MacBook and will use Windows for a while. I missed Textmate's folder view when editing my rails projects. Is there an editor on Windows with the folder view? I know there is the E text editor. But I'll save a few bucks if there is a free (cheaper) alternative, as I won't stay in Windows for long ...

    Read the article

  • Will MySQL full-text-search return the results I need?

    - by mike
    I have a keyword field with a list of 5 keywords for each item. example below: 2008, Honda, Accord, Used, Car Will MySQL full text return the item above for the following search requests? 2008 Honda Accord Honda Accord Used Car If so, how well will this hold up when searching through fifty thousand plus records?

    Read the article

  • How to index small words (3 letters) with SQL Full-text search?

    - by Sly
    I have an Incident table with one row that has the value 'out of office' in the Description column. However the following query does not return that row. SELECT * FROM Incident WHERE CONTAINS( (Incident.Description), '"out*"' ) The word 'out' is not in the noise file (I cleared the noise file completely). Is it because SQL Full-text search does not index small words? Is there a setting for that? Note: I'm on SQL 2005.

    Read the article

  • SQL Server Text type v.s. varchar data type

    - by George2
    Hello everyone, I have variable length character and want to store in SQL Server (2005) database. I want to learn some best practices about how to choose TEXT SQL type or choose VARCHAR SQL type, pros and cons in performance/footprint/function. thanks in advance, George

    Read the article

  • saving and retrieving a text file in java?

    - by user3319432
    import java.sql. ; import java.awt.; import javax.swing.; import java.awt.event.; public class saving extends JFrame implements ActionListener{ JTextField edpno=new JTextField(10); JLabel l0= new JLabel ("EDP Number: "); JComboBox fname = new JComboBox(); JLabel l1= new JLabel("First Name: "); JTextField lname= new JTextField(20); JLabel l2= new JLabel("Last Name: "); // JTextField contno= new JTextField(20); // JLabel l3= new JLabel("Contact Number: "); JComboBox contno = new JComboBox(); JLabel l3 = new JLabel ("Contact Number: "); JButton bOK = new JButton("Save"); JButton bRetrieve = new JButton("Retrieve"); private ImageIcon icon; JPanel C=new JPanel(){ protected void paintComponent(Graphics g){ g.drawImage(icon.getImage(),0,0,null); super.paintComponent(g); } }; public Search Record (){ icon=new ImageIcon("images/canres.png"); C.setOpaque(false); C.setLayout(new GridLayout(5,2,4,4)); setTitle("Search Record"); C.add (l0); C.add (edpno); edpno.addActionListener(this); C.add (l1); C.add (fname); fname.setForeground(Color.BLUE); fname.setFont(new Font(" ", Font.BOLD,15)); C.add (l2); C.add (lname); C.add (l3); C.add (contno); contno.setForeground(Color.BLUE); contno.setFont(new Font(" ", Font.BOLD,15)); C.add(bOK); bOK.addActionListener(this); C.add (bRetrieve); bRetrieve.addActionListener(this); bOK.setBackground(Color.white); bRetrieve.setBackground(Color.white); } public void saverecord(){ try{ //Connect to the Database Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String path ="jdbc:odbc:;DRIVER=Microsoft Access Driver (*.mdb);DBQ=Database/roomassign.mdb"; String DBPassword =""; String DBUserName =""; Connection con = DriverManager.getConnection(path,"",""); Statement s = con.createStatement(); s.executeQuery("select firstname, Lastname, contact number from name WHERE edpno ='"+edpno.getText()+"'"); ResultSet rs = s.getResultSet(); ResultSetMetaData md = rs.getMetaData(); while(rs.next()) { fname.setSelectedItem(rs.getString(1)); lname.setText(rs.getString(2)); contno.setSelectedItem(rs.getString(3)); // crs.setSelectedItem(rs.getString(4)); } s.close(); con.close(); } catch(Exception Q) { JOptionPane.showMessageDialog(this,Q); } } public void SaveRecord(){ try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String path = "jdbc:odbc:;DRIVER=Microsoft Access Driver (*.mdb);DBQ=Database/roomassign.mdb"; String DBPassword =""; String DBUsername =""; Connection con = DriverManager.getConnection(path,"",""); Statement s = con.createStatement(); String sql = "UPDATE rooms SET Firstname='"+fname.getSelectedItem()+"',Lastname='"+lname.getText()+"',Contactnumber='"+contno.getSelectedItem()+"' WHERE '"+edpno.getText()+"'=edpno"; s.executeUpdate(sql); JOptionPane.showMessageDialog(this,"New room Record has been successfully saved"); dispose(); s.close(); con.close(); } catch(Exception Mismatch){ JOptionPane.showMessageDialog(this,Mismatch); } } public void actionPerformed (ActionEvent ako){ if (ako.getSource() == bRetrieve){ dispose(); } else if (ako.getSource() == bOK){ SaveRecord(); } } public static void main (String [] awtsave){ new Search(); } }

    Read the article

  • search data from FileReader in Java

    - by maya
    hi I'm new in java how to read and search data from file (txt) and then display the data in TextArea or Jtable. for example I have file txt contains data and I need to display this data in textarea after I clicked a button, I have used FileReader , and t1 t2 tp are attributes in the file import java.io.FileReader; import java.io.IOException; String t1,t2,tp; Ffile f1= new Ffile(); FileReader fin = new FileReader("test2.txt"); Scanner src = new Scanner(fin); while (src.hasNext()) { t1 = src.next(); textarea.setText(t1); t2 = src.next(); textarea.setText(t2); tp = src.next(); textarea.setText(tp); f1.insert(t1,t2,tp); } fin.close(); also I have used the inputstream DataInputStream dis = null; String dbRecord = null; try { File f = new File("text2.text"); FileInputStream fis = new FileInputStream(f); BufferedInputStream bis = new BufferedInputStream(fis); dis = new DataInputStream while ( (dbRecord = dis.readLine()) != null) { StringTokenizer st = new StringTokenizer(dbRecord, ":"); String t1 = st.nextToken(); String t2 = st.nextToken(); String tp = st.nextToken(); textarea.setText(textarea.getText()+t1); textarea.setText(textarea.getText()+t2); textarea.setText(textarea.getText()+tp); } } catch (IOException e) { // catch io errors from FileInputStream or readLine() System.out.println("Uh oh, got an IOException error: " + e.getMessage()); } finally { } but both of them don't work ,so please any one help me I want to know how to read data and also search it from file and i need to display the data in textarea . thanks in advance

    Read the article

  • create TableModel and populate jTable dynamically

    - by Julia
    Hi all! I want to store the results of reading lucene index into jTable, so that I can make it sortable by different columns. From index I am reading terms with different measures of their frequencies. Table columns are these : [string term][int absFrequency][int docFrequency][double invFrequency] So i in AbstractTableModel I can define column names, but i dont know how to get the Object[][]data with results from the following method: public static void FrequencyMap(Directory indexDir) throws Exception { List<Object>redoviLista = new ArrayList<Object>(); //final Map<String,TermRow> map = new TreeMap<String,TermRow>(); List<String>termList = new ArrayList<String>(); IndexReader iReader = IndexReader.open(indexDir); FilterIndexReader fReader = new FilterIndexReader(iReader); int numOfDocs = fReader.numDocs(); TermEnum terms = fReader.terms(); while (terms.next()){ Term term = terms.term(); String termText = term.text(); termList.add(termText); //Calculating the frequencies int df = iReader.docFreq(term); double idf = 0.0F; idf = Math.log10((double) numOfDocs / df); double tfidf = (df*idf); //Here comes important part Object oneTableRow[] = {termText, df, idf, tfidf}; redoviLista.add(jedanRed); // So i thaught to store them into list, and then later to copy into table, but didnt manage } iReader.close(); // So I need something like this, and i Neeed this array to be stored out of this method Object[][]data = new Object[redoviLista.size()][]; for (int i = 0; i < data.length; i++) { data[i][0] = redoviLista.get(i); } So I am kindda stuck here to proceed to implement AbstractTableModel and populate and display this table .... :/ Please help!

    Read the article

  • Java - Custom PropertyEditorSupport to display units

    - by I82Much
    All, I'm trying to make the properties of my node have Units associated with the measure. ( I am using the JScience.org implementation of JSR 275) So for instance, public class Robot extends AbstractNode { // in kg float vehicleMass; @Override public Sheet createSheet() { Sheet s = Sheet.createDefault(); Sheet.Set set = s.createPropertiesSet(); try { PropertySupport.Reflection vehicleMassField = new PropertySupport.Reflection(this, float.class, "vehicleMass"); vehicleMassField.setValue("units", SI.KILOGRAMS); vehicleMassField.setName("vehicleMass"); set.put(vehicleMassField); PropertyEditorManager.registerEditor(float.class, UnitInPlaceEditor.class); } catch (NoSuchMethodException ex) { Exceptions.printStackTrace(ex); } s.put(set); return s; } } I want my UnitInPlaceEditor to append the units to the end of the string representation of the number, and when the field is clicked (enters edit mode) for the units to disappear and just the number becomes selected for editing. I can make the units appear, but I cannot get the units to disappear when the field enters editing mode. public class UnitsInplaceEditor extends PropertyEditorSupport implements ExPropertyEditor { private PropertyEnv pe; @Override public String getAsText() { // Append the unit by retrieving the stored value } @Override public void setAsText(String s) { // strip off the unit, parse out the number } public void attachEnv(PropertyEnv pe) { this.pe = pe; } } Here's a screenshot of the display - I like it like this.. but here's the value being edited; note the unit stays there. Basically I want one value (string) to be displayed in the field when the field is NOT being edited, and a different to be displayed when user starts editing the field. Barring that, I'd like to put a constant jlabel for the units (uneditable) to the right of the text field. Anyone know how to do this?

    Read the article

  • How to get a handle to all JCheckBox objects in order to loop?

    - by EmmyS
    I'm very new to Java and am having some issues looping through JCheckBoxes on a UI. The idea is that I have a bunch of checkboxes (not in a group because more than one can be selected.) When I click a JButton, I want to build a string containing the text from each selected checkbox. The issue I'm having is that our instructor told us that the checkboxes need to be created via a method, which means (see code below) that there isn't a discrete instance name for each checkbox. If there were, I could say something like if(checkBox1.isSelected()) { myString.append(checkBox.getText()); } That would repeat for checkBox2, checkBox3, and so on. But the method provided to us for adding checkboxes to a panel looks like this: public class CheckBoxPanel extends JPanel { private static final long serialVersionUID = 1L; public CheckBoxPanel(String title, String... options) { setBorder(BorderFactory.createTitledBorder(BorderFactory .createEtchedBorder(), title)); setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); // make one checkbox for each option for (String option : options) { JCheckBox b = new JCheckBox(option); b.setActionCommand(option); add(b); } } } This is called like this: toppingPanel = new CheckBoxPanel("Each Topping $1.50", "Tomato", "Green Pepper", "Black Olives", "Mushrooms", "Extra Cheese", "Pepperoni", "Sausage"); So I now have a panel that contains a border with the title "Each Topping $1.50", and 7 visible checkboxes. What I need to do is get a list of all the selected toppings. We are not supposed to use an ActionListener for each checkbox, but rather get the list when a button is clicked. I'm feeling really clueless here, but I just can't figure out how to get the isSelected property of the checkboxes when the individual checkboxes don't have instance names. Ideally I'd like to somehow add all the checkboxes to an array and loop through the array in the button's action listener to determine which ones are checked, but if I have to check each one individually I will. I just can't figure out how to refer to an individual checkbox when they've been created dynamically.

    Read the article

  • SwfUpload flash uploader not visible and not working in IOS

    - by Sunny
    i am working on a web application based on media gallery.In this application i am uploading media using SWFUpload either images and videos.When i try to open my application on IOS then uploader not visible there.Where it is working fine on safari installed on windows.I want some suggestions from experts of this field. one site who is using SWFUpload is http://www.ehproductions.com/mediaimage.htm. Here SwfUploader working nice on windows but not on IOS machines. Is there any javax html5 compatible uploader? Thanks in advance.

    Read the article

  • Synth LaF JLabel DISABLED color

    - by mmoris
    Hi all, Using the Synth LaF, I am unable to set a JLabel's FOREGROUND color for the DISABLED state. has anybody succeeded in doing this? Here is my label's style definition in my LaF.xml file. <style id="whiteLabelStyle"> <opaque value="false"/> <font name="Bitstream Vera Sans" size="16" /> <state> <color type="FOREGROUND" value="WHITE"/> </state> <state value="DISABLED"> <color type="FOREGROUND" value="BLACK"/> </state> </style> <bind style="whiteLabelStyle" type="name" key="WhiteOrbitLabel"/> Please not that all the other styles defined in my LaF.xml file are rendered properly in my application including my label's WHITE normal state color (it just never goes to black when I do lbl.setEnabled(false) Also, going through the Synth code, I have found the following comment in SynthStyle.getColor if ((context.getComponentState() & SynthConstants.DISABLED) != 0) { //This component is disabled, so return the disabled color. //In some cases this means ignoring the color specified by the //developer on the component. In other cases it means using a //specified disabledTextColor, such as on JTextComponents. //For example, JLabel doesn't specify a disabled color that the //developer can set, yet it should have a disabled color to the //text when the label is disabled. This code allows for that. if (c instanceof JTextComponent) { JTextComponent txt = (JTextComponent)c; Color disabledColor = txt.getDisabledTextColor(); if (disabledColor == null || disabledColor instanceof UIResource) { return getColorForState(context, type); } } else if (c instanceof JLabel && (type == ColorType.FOREGROUND || type == ColorType.TEXT_FOREGROUND)){ return getColorForState(context, type); } But I could not figure out how to set a disabled color for a JLabel Thanks for your help!

    Read the article

  • How to set JComboBox not to select an element when created? (Java)

    - by Alex Cheng
    Hi all. Problem: I am using JComboBox, and tried using setSelectionIndex(-1) in my code (this code is placed in caretInvoke()) suggestionComboBox.removeAllItems(); for (int i = 0; i < suggestions.length; i++) { suggestionComboBox.addItem(suggestions[i]); } suggestionComboBox.setSelectedIndex(-1); suggestionComboBox.setEnabled(true); This is the initial setting when it was added to a pane: suggestionComboBox = new JComboBox(); suggestionComboBox.setEditable(false); suggestionComboBox.setPreferredSize(new Dimension(25, 25)); suggestionComboBox.addActionListener(new SuggestionComboBoxListener()); When the caretInvoke triggers the ComboBox initialisation, even before the user selects an element, the actionPerformed is already triggered (I tried a JOptionPane here): First popup (notice that "flow byte_jump" is selected): Second popup (I think the setSelectionIndex is executed) Then in the end: The problem is: My program autoinserts the selected text when the user selects an element from the ComboBox. So without the user selecting anything, it is automatically inserted already. How can I overcome the problem in this situation? Thanks.

    Read the article

  • Word 2010 not printing body text on pages with images

    - by Oesor
    I've got a document exhibiting bizarre behavior -- when I print, the body text style is only displayed on pages without images. Headings, header and footer, and captions are printing on the page, along with any graphics such as border styles applied to the style, but the text itself doesn't print -- except for en dashes. The text is pretty basic -- a justified Calibri style. Images are their own style, a centered paragraph item. There's no floating image boxes or text boxes going on, everything's a paragraph style. It's not a print driver issue. I get identical behavior on both a HP and Brother laser printer. It's also not a paragraph-level style issue; I've inserted enough dummy text to move a printing paragraph on a page with no images to the next page, which has an image, and the paragraph does not print on the next page. Has anyone run into an issue like this and knows the solution?

    Read the article

  • Microsoft Outlook 2007 Plain Text/HTML message behaviour?

    - by goldenmean
    I use MS Outlook as email client. When I receive email from certain email addresses(sender within my company/domain itself), and I use the reply button option to reply it, all the menus like - Font type, Font size, Text color, Bold, Italics, Text indentation, Bullets, numbering, are disabled. It doesn't allow me to use any of the above features. This happens only for some email id's where I receive mail from. Not all. Then when I checked in the message properties, it was Plain Text , rather than HTML. But shouldn't outlook allow me the formatting of the messages I reply/compose based on My settings which are HTML? How can I enable to have Rich text formatting enabled while I reply to a text mail?

    Read the article

  • Set Thunderbird to always reply using plain text [closed]

    - by stefan.at.wpf
    Possible Duplicate: How do I tell Thunderbird never to send (or even try to send) html emails? In the account settings of Thunderbird (version 11.0.1) I have disabled HTML and set it to compose messages as plain text. That works for new messages. However, when I get an HTML email and reply to that mail, Thunderbird uses HTML. I went to the setting in: Tools ? Options ? Composition ? Send Options ? Plain Text Domains And have tried *.* as the domain name. I also changed the default text format in Settings - Compose - Send options. Neither of them works, the reply is still using HTML (for my own text). How can I really reply in plain text only, regardless of incoming?

    Read the article

  • 'Content' is NOT 'Text' in XAML

    - by psheriff
    One of the key concepts in XAML is that the Content property of a XAML control like a Button or ComboBoxItem does not have to contain just textual data. In fact, Content can be almost any other XAML that you want. To illustrate here is a simple example of how to spruce up your Button controls in Silverlight. Here is some very simple XAML that consists of two Button controls within a StackPanel on a Silverlight User Control. <StackPanel>  <Button Name="btnHome"          HorizontalAlignment="Left"          Content="Home" />  <Button Name="btnLog"          HorizontalAlignment="Left"          Content="Logs" /></StackPanel> The XAML listed above will produce a Silverlight control within a Browser that looks like Figure 1.   Figure 1: Normal button controls are quite boring. With just a little bit of refactoring to move the button attributes into Styles, we can make the buttons look a little better. I am a big believer in Styles, so I typically create a Resources section within my user control where I can factor out the common attribute settings for a particular set of controls. Here is a Resources section that I added to my Silverlight user control. <UserControl.Resources>  <Style TargetType="Button"         x:Key="NormalButton">    <Setter Property="HorizontalAlignment"            Value="Left" />    <Setter Property="MinWidth"            Value="50" />    <Setter Property="Margin"            Value="10" />  </Style></UserControl.Resources> Now back in the XAML within the Grid control I update the Button controls to use the Style attribute and have each button use the Static Resource called NormalButton. <StackPanel>  <Button Name="btnHome"          Style="{StaticResource NormalButton}"          Content="Home" />  <Button Name="btnLog"          Style="{StaticResource NormalButton}"          Content="Logs" /></StackPanel> With the additional attributes set in the Resources section on the Button, the above XAML will now display the two buttons as shown in Figure 2. Figure 2: Use Resources to Make Buttons More Consistent Now let’s re-design these buttons even more. Instead of using words for each button, let’s replace the Content property to use a picture. As they say… a picture is worth a thousand words, so let’s take advantage of that. Modify each of the Button controls and eliminate the Content attribute and instead, insert an <Image> control with the <Button> and the </Button> tags. Add a ToolTip to still display the words you had before in the Content and you will now have better looking buttons, as shown in Figure 3.   Figure 3: Using pictures instead of words can be an effective method of communication The XAML to produce Figure 3 is shown in the following listing: <StackPanel>  <Button Name="btnHome"          ToolTipService.ToolTip="Home"          Style="{StaticResource NormalButton}">    <Image Style="{StaticResource NormalImage}"            Source="Images/Home.jpg" />  </Button>  <Button Name="btnLog"          ToolTipService.ToolTip="Logs"          Style="{StaticResource NormalButton}">    <Image Style="{StaticResource NormalImage}"            Source="Images/Log.jpg" />  </Button></StackPanel> You will also need to add the following XAML to the User Control’s Resources section. <Style TargetType="Image"        x:Key="NormalImage">  <Setter Property="Width"          Value="50" /></Style> Add Multiple Controls to Content Now, since the Content can be whatever we want, you could also modify the Content of each button to be a StackPanel control. Then you can have an image and text within the button. <StackPanel>  <Button Name="btnHome"          ToolTipService.ToolTip="Home"          Style="{StaticResource NormalButton}">    <StackPanel>      <Image Style="{StaticResource NormalImage}"              Source="Images/Home.jpg" />      <TextBlock Text="Home"                  Style="{StaticResource NormalTextBlock}" />    </StackPanel>  </Button>  <Button Name="btnLog"          ToolTipService.ToolTip="Logs"          Style="{StaticResource NormalButton}">    <StackPanel>      <Image Style="{StaticResource NormalImage}"              Source="Images/Log.jpg" />      <TextBlock Text="Logs"                  Style="{StaticResource NormalTextBlock}" />    </StackPanel>  </Button></StackPanel> You will need to add one more resource for the TextBlock control too. <Style TargetType="TextBlock"        x:Key="NormalTextBlock">  <Setter Property="HorizontalAlignment"          Value="Center" /></Style> All of the above will now produce the following:   Figure 4: Add multiple controls to the content to make your buttons even more interesting. Summary While this is a simple example, you can see how XAML Content has great flexibility. You could add a MediaElement control as the content of a Button and play a video within the Button. Not that you would necessarily do this, but it does work. What is nice about adding different content within the Button control is you still get the Click event and other attributes of a button, but it does necessarily look like a normal button. Good Luck with your Coding,Paul Sheriff ** SPECIAL OFFER FOR MY BLOG READERS **Visit http://www.pdsa.com/Event/Blog for a free video on Silverlight entitled "Silverlight XAML for the Complete Novice - Part 1."

    Read the article

< Previous Page | 69 70 71 72 73 74 75 76 77 78 79 80  | Next Page >