Search Results

Search found 2381 results on 96 pages for 'vertical alignment'.

Page 18/96 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • How do I vertcally align thumbnails of unknown height using jQuery?

    - by playahabana
    Ok, I am a complete beginner to this, in fact I am still building my first website. I am attempting to do this all by hand-coding without a CMS in order to try and learn as much possible as quickly as possible. If this post is in the wrong place I apologise, and a pointer to right place would be appreciated. Here goes, I am trying to peice together a bit of jQuery that will automatically vertically align my thumbnails in my image gallery (they are all different sizes). They are within fixed size div's and the function I am attempting looks something like this: <script type="text/javascript"> $('#ul.photo).bind(function() { var smartVert=$(this); var phty=ob.("ul.photo img").height(); //get height of photos var phtdif=Math.floor(208 - phty); //subtract height of photo from div height var phttop=Math.floor(phtdif / 2); //gets padding reqd. $ob.("ul.photo").css({'padding-top' : phttop}) //sets padding to center thumbnail }); smartVert(); unsurprisingly this doesn't work, if some kindly soul could take pity on a total noob, and point out where I am going wrong (probably in writing complete gibberish would be my first guess) it would be greatly appreciated- even if you could just point me in the direcion of a tutorial regarding these things, I have looked and found one reference that said such a function was easy to create, but it did not elaborate. thankyou in advance

    Read the article

  • How to create "floating TextViews" in Android?

    - by Sotapanna
    Hi stackies, I'm programmatically putting various TextViews into a LinearLayout with a horizontal orientation. After 2h of research I couldn't find out how to tell Android not to squeeze all the TextViews in one line but instead to "float" non-fitting TextViews into the next line. I know there isn't something like actual "lines" in a LinearLayout, but how can I tell the TextViews to actually behave like floating DIVs from the HTML world? Thanks alot! Be well S.

    Read the article

  • Centering An Inline-Block DIV

    - by Aaron Brewer
    Does anybody know how to center align a DIV that has the display set to inline-block? I cannot set the display to block because I have a background image that needs to be repeated, and it needs to expand based on the content. It sits inside of a parent div, in which is larger when it comes to width. So all in all. Does anyone have a fix to center align a div with the display set to inline-block? And no, text-align: center; does not work, nor does margin: 0 auto; jsFiddle: http://jsfiddle.net/HkvzM/ Thank you!

    Read the article

  • Aligning left and right in a simple footer

    - by Wolfram
    I'm currently working on a simple footer, and I would like to align one line of text left and the other to the right. This is what I have so far: <div id="footer"> Last Updated: October 15, 2012 <!--left align--> Contact Us Login <!--right align (these will be links)--> </div> #footer { font-family: Arial; font-size: .9em; color: #24ACAE; border-top: 1px solid #24ACAE; margin-left: 90px; margin-right: 90px; padding-top: 5px; } The above code results in the two lines of text being next to each other and I've tried various ways of fixing this such as putting the the 2nd line in a span and aligning right and even putting the lines into a table. None of what I have tried has resulted in both lines being properly aligned. Using a margin-left alone does not work because when the first line is updated and becomes longer, it will push the second line downwards. Relative positioning seems to have the same issue. Hopefully there's something simple that I'm overlooking.

    Read the article

  • Displaying a list of items vertically in a table instead of horizonally

    - by MichaelMM
    I have a list of items sorted alphabetically: list = [a,b,c,d,e,f,g,h,i,j] I'm able to output the list in an html table horizonally like so: | a , b , c , d | | e , f , g , h  | | i  , j  ,    ,     | What's the algorithm to create the table vertically like this: | a , d , g , j | | b , e , h ,   | | c , f  ,  i  ,  | I'm using python, but your answer can be in any language or even pseudocode. Thanks

    Read the article

  • RTL shows numbers at the end of lines

    - by Tiger
    Hi. Trying to display a hebrew string that starts with a number, always displays the number at the end of the string like so: 1. ??? ???? ????? but I need the number to be displayed at the right side of the text- any solution to that? It happens with UILabel & UITextField & UITextView and trying to write the number at the left side also produce the same resault. Playing with combinations of UITextAlignment will doesn't help.

    Read the article

  • Aligning divs with different dimensions horizontally.

    - by serg555
    I have a tag cloud with different font sizes. <div> <a style="font-size:15px;">tag1</a> <a style="font-size:10px;">tag1</a> </div> And it looks like this: Now I need to wrap each tag into its own div: <style> .cloud {float:left} .tag {float:left} </style> <div class="cloud"> <div class="tag"><a style="font-size:15px;">tag1</a></div> <div class="tag"><a style="font-size:10px;">tag1</a></div> </div> Which puts them all over the place. How to make them look like on the first picture?

    Read the article

  • Misaligned Pointer Performance

    - by Elite Mx
    Aren't misaligned pointers (in the BEST possible case) supposed to slow down performance and in the worst case crash your program (assuming the compiler was nice enough to compile your invalid c program). Well, the following code doesn't seem to have any performance differences between the aligned and misaligned versions. Why is that? /* brutality.c */ #ifdef BRUTALITY xs = (unsigned long *) ((unsigned char *) xs + 1); #endif ... /* main.c */ #include <stdio.h> #include <stdlib.h> #define size_t_max ((size_t)-1) #define max_count(var) (size_t_max / (sizeof var)) int main(int argc, char *argv[]) { unsigned long sum, *xs, *itr, *xs_end; size_t element_count = max_count(*xs) >> 4; xs = malloc(element_count * (sizeof *xs)); if(!xs) exit(1); xs_end = xs + element_count - 1; sum = 0; for(itr = xs; itr < xs_end; itr++) *itr = 0; #include "brutality.c" itr = xs; while(itr < xs_end) sum += *itr++; printf("%lu\n", sum); /* we could free the malloc-ed memory here */ /* but we are almost done */ exit(0); } Compiled and tested on two separate machines using gcc -pedantic -Wall -O0 -std=c99 main.c for i in {0..9}; do time ./a.out; done

    Read the article

  • Aligning all panel components java

    - by destructo_gold
    I am using the BoxLayout layout manager in java, and have aligned a bunch of components: myLabel.setAlignmentX(Component.LEFT_ALIGNMENT); myTextBox.setAlignmentX(Component.LEFT_ALIGNMENT); myButton.setAlignmentX(Component.LEFT_ALIGNMENT); ... I have a lot of components, and this seems over the top. Is there a shorthand way? I tried the following, but setAlignmentX isn't a method inside Component? for (Component c : personPanel.getComponents()) { c.setAlignmentX(Component.LEFT_ALIGNMENT); }

    Read the article

  • Align/Wrap images around div

    - by Ryan Phillips
    What I'm trying to achieve is a page with a div centered in the middle of the screen (720x360). This is done with jQuery using $(window).height() and $(window).width() and works perfectly. The next part is getting 180x180 images to fit around that middle div. These will fill the screen + beyond. I'm stuck on how to get these to align that way and I couldn't find a live example of anyone doing the same thing. So, is this even possible? Thanks, Any help is appreciated!

    Read the article

  • Skeleton framework - css list spacing

    - by user1745014
    I'm trying to float my navigation at the top much more to left around 200px atleast more towards the end of the line that can been seen below. Everytime I apply a margin or padding it pushes the navigation to go under each other even though there is loads of room, could anyone take a look at my code. means alot thanks, I always find things easier with firebug so I uploaded it here http://xronn.co.uk/hosting/ Thanks again!

    Read the article

  • How to achieve Bottom Align floated div that sizes to it's container.

    - by Davy8
    How can I achieve the following layout? Specifically the positioning of Image and DIV I've found that unless I set a specific width for the Div, it will just go on to the next line and take up the full width of the container. Additionally aligning it relative to the bottom of the image is giving me trouble. Currently they're both float:left Edit: The two solutions so far work if the image is a constant width which I guess I could work with, but it's going in a Wordpress theme for an author's profile page and it's possible that images would have slightly variable widths. Is there a solution that would have the Div right next to the image (minus padding) regardless of how wide or narrow the image is? Basically having the div adjust its width to accommodate the image width.

    Read the article

  • Unable to center text in IE but works in firefox

    - by greenpool
    Can somebody point out where I'm going wrong with the following code. Text inside td elements need to be centered except for Summary and Experience. This only appears to work in Firefox/chrome. In IE8 all td text are displayed as left-justified. No matter what I try it doesn't center it. Any particular reason why this would happen? Thanks. css #viewAll { font-family:"Trebuchet MS", Arial, Helvetica, sans-serif; width:100%; border-collapse:collapse; margin-left:10px; table-layout: fixed; } #viewAll td, #viewAll th { font-size:1.1em; border:1px solid #98bf21; word-wrap:break-word; text-align:center; overflow:hidden; } #viewAll tbody td{ padding:2px; } #viewAll th { font-size:1.1em; padding-top:5px; padding-bottom:4px; background-color:#A7C942; color:#ffffff; } table <?php echo '<table id="viewAll" class="tablesorter">'; echo '<thead>'; echo '<tr align="center">'; echo '<th style="width:70px;">Product</th>'; echo '<th style="width:105px;">Prob</th>'; echo '<th style="width:105px;">I</th>'; echo '<th style="width:60px;">Status</th>'; echo '<th style="width:120px;">Experience</th>'; echo '<th style="width:200px;">Technical Summary</th>'; echo '<th style="width:80px;">Record Created</th>'; echo '<th style="width:80px;">Record Updated</th>'; echo '<th style="width:50px;">Open</th>'; echo '</tr>'; echo '</thead>'; echo '<tbody>'; while ($data=mysqli_fetch_array($result)){ #limiting the summary text displayed in the table $limited_summary = (strlen($data['summary']) > 300) ? substr(($data['summary']),0,300) . '...' : $data['summary']; $limited_exp = (strlen($data['exp']) > 300) ? substr(($data['exp']),0,300) . '...' : $data['exp']; echo '<tr align="center"> <td style="width:70px; text-align:center;">'.$data['product'].'</td>'; //if value is '-' do not display as link if ($data['prob'] != '-'){ echo '<td style="width:105px;">'.$data['prob'].'</a></td>'; } else{ echo '<td style="width:105px; ">'.$data['prob'].'</td>'; } if ($data['i'] != '-'){ echo '<td style="width:105px; ">'.$data['i'].'</a></td>'; } else{ echo '<td style="width:105px; ">'.$data['i'].'</td>'; } echo'<td style="width:40px; " >'.$data['status'].'</td> <td style="width:120px; text-align:left;">'.$limited_cust_exp.'</td> <td style="width:200px; text-align:left;">'.$limited_summary.'</td> <td style="width:80px; ">'.$data['created'].'</td> <td style="width:80px; ">'.$data['updated'].'</td>'; if (isset($_SESSION['username'])){ echo '<td style="width:50px; "> <form action="displayRecord.php" method="get">'.' <input type="hidden" name="id" value="'. $data['id'].'" style="text-decoration: none" /><input type="submit" value="Open" /></form></td>'; }else{ echo '<td style="width:50px; "> <form action="displayRecord.php" method="get">'.' <input type="hidden" name="id" value="'. $data['id'].'" style="text-decoration: none" /><input type="submit" value="View" /></form></td>'; } echo '</tr>'; }#end of while echo '</tbody>'; echo '</table>'; ?>

    Read the article

  • Align a set of elements that are not next to each other in the HTML

    - by user1917727
    I am creating a comparison table where the columns are built as below: <div id = "wrapper"> <div id = "col1"> <div class = "row1"> text lots more text and more text </div> <div class = "row2"> text </div> <div class = "row3"> text </div> </div> <div id = "col2"> <div class = "row1"> text </div> <div class = "row2"> a lot of text </div> <div class = "row3"> text </div> </div> </div> Col1 and col2 are then displayed as an inline-block so they visually sit next to each other on the page. The problem is that the contents of each row may vary. Without setting a min-height of each row, how could i make sure that each row visually lines up with its corresponding row from the other column? I can't think of any way to achieve this in CSS alone. I'm wondering if there's some sneaky jQuery way of achieving this? EDIT: I Can't change the HTML structure. Cheers

    Read the article

  • Tab Sweep: CDI Tutorial, Vertical Clustering, Monitoring, Vorpal, SPARC T4, ...

    - by arungupta
    Recent Tips and News on Java, Java EE 6, GlassFish & more : • Tutorial - Introduction to CDI - Contexts and Dependency Injection for Java EE (JSR 299) (Mark Struberg, Peter Muir) • Clustering with Glassfish 3.1 (Javing) • Two Way Communication in JMS (Lukasz Budnik) • Glassfish – Vertical clustering with multiple domains (Alexandru Ersenie) • Setting up Glassfish Monitoring – handling connection problems (Jacek Milewski) • Screencast: Developing Discoverable XMPP Components with Vorpal (Chuk Munn Lee) • Java EE Application Servers, SPARC T4, Solaris Containers, and Resource Pools (Jeff Taylor)

    Read the article

  • How do you make a bullet ricochet off a vertical wall?

    - by Bagofsheep
    First things first. I am using C# with XNA. My game is top-down and the player can shoot bullets. I've managed to get the bullets to ricochet correctly off horizontal walls. Yet, despite using similar methods (e.g. http://stackoverflow.com/questions/3203952/mirroring-an-angle) and reading other answered questions about this subject I have not been able to get the bullets to ricochet off a vertical wall correctly. Any method I've tried has failed and sometimes made ricocheting off a horizontal wall buggy. Here is the collision code that calls the ricochet method: //Loop through returned tile rectangles from quad tree to test for wall collision. If a collision occurs perform collision logic. for (int r = 0; r < returnObjects.Count; r++) if (Bullets[i].BoundingRectangle.Intersects(returnObjects[r])) Bullets[i].doCollision(returnObjects[r]); Now here is the code for the doCollision method. public void doCollision(Rectangle surface) { if (Ricochet) doRicochet(surface); else Trash = true; } Finally, here is the code for the doRicochet method. public void doRicochet(Rectangle surface) { if (Position.X > surface.Left && Position.X < surface.Right) { //Mirror the bullet's angle. Rotation = -1 * Rotation; //Moves the bullet in the direction of its rotation by given amount. moveFaceDirection(Sprite.Width * BulletScale.X); } else if (Position.Y > surface.Top && Position.Y < surface.Bottom) { } } Since I am only dealing with vertical and horizontal walls at the moment, the if statements simply determine if the object is colliding from the right or left, or from the top or bottom. If the object's X position is within the boundaries of the tile's X boundaries (left and right sides), it must be colliding from the top, and vice verse. As you can see, the else if statement is empty and is where the correct code needs to go.

    Read the article

  • In subform of a MS Access form, how to hide/show the vertical scroll bars as needed?

    - by PowerUser
    I have a subform in an MS Access form which is not hiding/showing the vertical scroll bars as needed. In the example picture, the vertical scroll bar is showing even though there aren't enough records to warrant vertical scrolling. How do I get the scroll bars to show only when they are needed? Do I need to add an if-then condition to the on_load event? or is there an easier option?

    Read the article

  • How to make BoxLayout vertical but children flow top-aligned?

    - by user291701
    I'm trying to get get a vertical, top-aligned layout to work. This is what I have: JPanel pane = new JPanel(); pane.setLayout(new BoxLayout(pane, BoxLayout.Y_AXIS)); MyImagePanel panelImage = new MyImagePanel(); panelImage.setSize(400, 400); pane.add(new JComboBox()); pane.add(panelImage); pane.add(new JButton("1")); pane.add(new JButton("2")); pane.add(new JButton("3")); JFrame frame = new JFrame("Title"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(800, 600); frame.add(pane); frame.pack(); frame.setVisible(true); All the controls appear, but it looks like padding is being applied at run time between their tops and bottoms so they're somewhat vertically centered. This is what I'm going for: ----------------------------------------------------- | ComboBox | | ------------ | | | | | Image | | | | | ------------ | | Button 1 | Any additional space fills the right | ------------ | | Button 2 | | ------------ | | Button 3 | | ------------ | | | | Any additional space fills the bottom | | | ----------------------------------------------------- How do I get BoxLayout to do that? Thanks ------------------------- Update ------------------------- Was able to use this: Box vertical = Box.createVerticalBox(); frame.add(vertical, BorderLayout.NORTH); vertical.add(new JComboBox()); vertical.add(new JButton("1")); ... to get what I wanted.

    Read the article

  • GroupLayout: JScrollPane in TextArea is not working

    - by Dozent
    i'm new in java and recently started to develop an simple application. For the moment i have a problem with JScrollPanne, it's not able to scroll down (or up) when the text in textarea more than size of area. I have looked to some solutions, but all of them were for FlowLayot (GridLayout and BoxLayout), but not for GroupLayout. Here is the code: JPanel conent_p = new JPanel(); conent_p.setBorder(new TitledBorder(null, "", TitledBorder.LEADING, TitledBorder.TOP, null, null)); JLabel lblItemName = new JLabel("Item name:"); itemField = new JTextField(); itemField.setColumns(10); JLabel lblMxPrice = new JLabel("Max price:"); mpriceField = new JTextField(); mpriceField.setColumns(10); JLabel lblQuantity = new JLabel("Quantity:"); quanField = new JTextField(); quanField.setColumns(10); JLabel lblDelivery = new JLabel("Delivery:"); delivField = new JTextField(); delivField.setColumns(10); JLabel lblLogcat = new JLabel("LogCat:"); final JTextArea txtConsole = new JTextArea(); txtConsole.setEditable(false); txtConsole.setLineWrap(true); txtConsole.setWrapStyleWord(true); sbrText = new JScrollPane(txtConsole); sbrText.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); // Now create a new TextAreaOutputStream to write to our JTextArea control and wrap a // PrintStream around it to support the println/printf methods. PrintStream out = new PrintStream(new TextAreaOutputStream(txtConsole)); // redirect standard output stream to the TextAreaOutputStream System.setOut(out); // redirect standard error stream to the TextAreaOutputStream System.setErr(out); GroupLayout gl_conent_p = new GroupLayout(conent_p); gl_conent_p.setHorizontalGroup( gl_conent_p.createParallelGroup(Alignment.LEADING) .addGroup(gl_conent_p.createSequentialGroup() .addContainerGap() .addGroup(gl_conent_p.createParallelGroup(Alignment.LEADING) .addComponent(lblMxPrice, Alignment.TRAILING) .addComponent(lblItemName, Alignment.TRAILING) .addComponent(lblLogcat, Alignment.TRAILING)) .addGap(18) .addGroup(gl_conent_p.createParallelGroup(Alignment.LEADING) .addGroup(gl_conent_p.createSequentialGroup() .addGroup(gl_conent_p.createParallelGroup(Alignment.LEADING, false) .addComponent(itemField, GroupLayout.PREFERRED_SIZE, 365, GroupLayout.PREFERRED_SIZE) .addGroup(gl_conent_p.createSequentialGroup() .addComponent(mpriceField, GroupLayout.PREFERRED_SIZE, 80, GroupLayout.PREFERRED_SIZE) .addGap(18) .addComponent(lblQuantity) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(quanField, 0, 0, Short.MAX_VALUE) .addGap(18) .addComponent(lblDelivery) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(delivField, GroupLayout.PREFERRED_SIZE, 80, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED))) .addGap(100)) .addGroup(gl_conent_p.createSequentialGroup() .addComponent(txtConsole, GroupLayout.PREFERRED_SIZE, 345, GroupLayout.PREFERRED_SIZE) .addComponent(sbrText) .addContainerGap()))) ); gl_conent_p.setVerticalGroup( gl_conent_p.createParallelGroup(Alignment.LEADING) .addGroup(gl_conent_p.createSequentialGroup() .addContainerGap() .addGroup(gl_conent_p.createParallelGroup(Alignment.BASELINE) .addComponent(lblItemName) .addComponent(itemField, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)) .addGap(20) .addGroup(gl_conent_p.createParallelGroup(Alignment.LEADING) .addGroup(gl_conent_p.createParallelGroup(Alignment.BASELINE) .addComponent(lblDelivery) .addComponent(delivField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addGroup(gl_conent_p.createParallelGroup(Alignment.BASELINE) .addComponent(lblMxPrice) .addComponent(mpriceField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(lblQuantity) .addComponent(quanField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))) .addGap(55) .addGroup(gl_conent_p.createParallelGroup(Alignment.BASELINE) .addComponent(lblLogcat) .addComponent(txtConsole, GroupLayout.PREFERRED_SIZE, 200, GroupLayout.PREFERRED_SIZE) .addComponent(sbrText)) .addContainerGap()) ); conent_p.setLayout(gl_conent_p); getContentPane().add(conent_p, BorderLayout.NORTH); JButton btnBuy = new JButton("Buy"); btnBuy.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent ev) { try { String title = itemField.getText().trim(); String mprice = mpriceField.getText().trim(); String quantity = quanField.getText().trim(); String deliver = delivField.getText().trim(); Item_CONCEPT item = new Item_CONCEPT(); item.setName(title); item.setDelivery(Integer.parseInt(deliver)); item.setStartPrice(0); item.setMaxPrice(Integer.parseInt(mprice)); myAgent.existsSeller(item); Date date = new Date(); DateFormat df = new SimpleDateFormat("dd.MM.yy HH:mm"); System.out.println(df.format(date)+": Buyer orders an item: "+item.getName()); //Clearing all fields itemField.setText(""); quanField.setText(""); delivField.setText(""); //txtConsole.setText(""); mpriceField.setText(""); } catch (Exception e) { JOptionPane.showMessageDialog(BuyerGUI.this, "A field is filled incorrectly. "+e.getMessage()+" is invalid.", "Error", JOptionPane.ERROR_MESSAGE); } } } );![enter image description here][1]

    Read the article

  • Making a app show inside a GUI in Java

    - by José
    Hello. I have one problem I've been dealing with for this week. You see, I'm new to Java, so that's probably it... Anyways, I've started a project out of pure curiosity. I had it done in Java, but in plain CMD-style, which is not very pretty. It calls one of my ten programs, chosen by the user using "Case". Eg.: If you type 1, it will go to program 1. After you finish it, it goes back to selection until the user press 0. After that, I've been trying to make a GUI for it. I've been able to create the selector alone and make it respond to the numbers chosen. If you press 1 and click ok, it will tell you you've chosen program 1. I, however, have not been able to make it run the program. I've been trying to make the program show up in a jPanel, part of the main GUI. I failed miserably. The program runs in separate but I can't make them run together like the CMD one. The apps were made in Eclipse SDK 3.5.2 The GUIs were made in Netbeans IDE 6.8 Here's the code for the GUI only (the prints are in PT-BR, my native language): Main program: /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * ProgramasGUI.java * * Created on 31/01/2010, 22:56:19 */ package Main; import Main.Prog1; /** * * @author Zeh® */ public class ProgramasGUI extends javax.swing.JFrame { /** Creates new form ProgramasGUI */ public ProgramasGUI() { 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() { selecao = new javax.swing.JTextField(); mostrador = new javax.swing.JLabel(); selecionar = new javax.swing.JButton(); mostrador1 = new javax.swing.JLabel(); jPanel1 = new javax.swing.JPanel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); selecao.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { selecaoActionPerformed(evt); } }); mostrador.setText("Qual o programa desejado?"); selecionar.setText("OK"); selecionar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { selecionarActionPerformed(evt); } }); mostrador1.setText("Saiba aqui o Programa escolhido!"); jPanel1.addComponentListener(new java.awt.event.ComponentAdapter() { public void componentShown(java.awt.event.ComponentEvent evt) { jPanel1ComponentShown(evt); } }); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 100, Short.MAX_VALUE) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 100, Short.MAX_VALUE) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(selecao, javax.swing.GroupLayout.PREFERRED_SIZE, 203, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(selecionar, javax.swing.GroupLayout.DEFAULT_SIZE, 203, Short.MAX_VALUE)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(mostrador1, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(mostrador, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(layout.createSequentialGroup() .addGap(162, 162, 162) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap(39, Short.MAX_VALUE) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(30, 30, 30) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(selecao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(mostrador, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(selecionar) .addComponent(mostrador1)) .addContainerGap()) ); pack(); }// </editor-fold> private void selecaoActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: } private void selecionarActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: int programa = (int)((Double.parseDouble(selecao.getText()))); switch (programa) { case 1: mostrador1.setText("O programa " + programa + " foi escolhido!" ); break; case 2: mostrador1.setText("O programa " + programa + " foi escolhido!" ); break; case 3: mostrador1.setText("O programa " + programa + " foi escolhido!" ); break; case 4: mostrador1.setText("O programa " + programa + " foi escolhido!" ); break; case 5: mostrador1.setText("O programa " + programa + " foi escolhido!" ); break; case 6: mostrador1.setText("O programa " + programa + " foi escolhido!" ); break; case 7: mostrador1.setText("O programa " + programa + " foi escolhido!" ); break; case 8: mostrador1.setText("O programa " + programa + " foi escolhido!" ); break; case 9: mostrador1.setText("O programa " + programa + " foi escolhido!" ); break; case 10: mostrador1.setText("O programa " + programa + " foi escolhido!" ); break;} } private void jPanel1ComponentShown(java.awt.event.ComponentEvent evt) { int programa = (int)((Double.parseDouble(selecao.getText()))); switch (programa) { case 1: addNotify(Prog1.); break;} } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new ProgramasGUI().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JPanel jPanel1; private javax.swing.JLabel mostrador; private javax.swing.JLabel mostrador1; private javax.swing.JTextField selecao; private javax.swing.JButton selecionar; // End of variables declaration } And here's the sub-program: /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * Prog1.java * * Created on 02/02/2010, 23:57:59 */ package Main; /** * * @author Zeh® */ public class Prog1 extends javax.swing.JPanel { /** Creates new form Prog1 */ public Prog1() { 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() { jLabel1 = new javax.swing.JLabel(); numesc = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jButton1 = new javax.swing.JButton(); campo = new javax.swing.JTextField(); jLabel1.setText("Saiba aqui o Antecessor!"); numesc.setText("O número escolhido é: X"); jLabel3.setText("Saiba aqui o Sucessor!"); jLabel4.setText("Insira um número para saber seu Antecessor e Sucessor!"); jButton1.setText("Calcular!"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); campo.setText("Insira seu número"); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(16, 16, 16) .addComponent(jButton1)) .addComponent(campo, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(10, 10, 10) .addComponent(jLabel3)) .addGroup(layout.createSequentialGroup() .addGap(10, 10, 10) .addComponent(numesc, javax.swing.GroupLayout.DEFAULT_SIZE, 154, Short.MAX_VALUE)) .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE))) .addComponent(jLabel4)) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel4) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(campo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel1)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(numesc) .addGap(11, 11, 11) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3) .addComponent(jButton1)) .addContainerGap(24, Short.MAX_VALUE)) ); }// </editor-fold> private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { int num = (int)((Double.parseDouble(campo.getText()))); numesc.setText("O número escolhido é: " + num); int x = num-1; jLabel1.setText ("O antecessor é: " + x); int y = num+1; jLabel3.setText ("O sucessor é: " + y); } // Variables declaration - do not modify private javax.swing.JTextField campo; private javax.swing.JButton jButton1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel numesc; // End of variables declaration } Any help would be very appreciated. If I, for some reason, made a mistake typing and/or setting the layout of this post incorrectly, please accept my apologies.

    Read the article

  • Mac OS X bug: Desktop & Screen Saver: image alignment preference is ignored.

    - by Aaron F.
    I have my desktop background set to rotate through a folder of images. Even though I have the alignment drop-down list set to "Center", the images still render as "Fill to Screen". When I change the list value to something else, then back to "Center", OR I manually click on a different image to display, well, that image is rendered as "Center". But all images that follow (via the "Change picture every x minutes" checkbox) are rendered as Fill to Screen. Any fix to this bug?

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >